mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-08-15 14:43:32 -07:00
Don't track fullscreen mode
Some checks failed
checkrefs / lfscheck (push) Has been cancelled
checkrefs / checkrefs (push) Has been cancelled
lint / cppcheck (push) Has been cancelled
lint / copyright (push) Has been cancelled
lint / jenkinsfiles (push) Has been cancelled
pre-commit / build (push) Has been cancelled
Some checks failed
checkrefs / lfscheck (push) Has been cancelled
checkrefs / checkrefs (push) Has been cancelled
lint / cppcheck (push) Has been cancelled
lint / copyright (push) Has been cancelled
lint / jenkinsfiles (push) Has been cancelled
pre-commit / build (push) Has been cancelled
SDL already does it. Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
parent
89c6bd5de6
commit
9add728945
2 changed files with 6 additions and 12 deletions
|
|
@ -293,7 +293,7 @@ Input::Reaction CVideoMode::InputHandler::operator()(const SDL_Event& ev)
|
|||
return Input::Reaction::HANDLED;
|
||||
}
|
||||
}
|
||||
if (ev.type == SDL_WINDOWEVENT && !videoMode.m_IsFullscreen)
|
||||
if (ev.type == SDL_WINDOWEVENT && !videoMode.IsInFullscreen())
|
||||
{
|
||||
switch (ev.window.event)
|
||||
{
|
||||
|
|
@ -509,7 +509,7 @@ bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (m_IsFullscreen != fullscreen)
|
||||
if (IsInFullscreen() != fullscreen)
|
||||
{
|
||||
if (!fullscreen)
|
||||
{
|
||||
|
|
@ -548,8 +548,6 @@ bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen)
|
|||
else
|
||||
SDL_SetWindowGrab(m_Window, SDL_FALSE);
|
||||
|
||||
m_IsFullscreen = fullscreen;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -647,7 +645,6 @@ void CVideoMode::Shutdown()
|
|||
|
||||
m_Cursor.reset();
|
||||
|
||||
m_IsFullscreen = false;
|
||||
m_IsInitialised = false;
|
||||
|
||||
if (m_BackendDevice)
|
||||
|
|
@ -805,10 +802,10 @@ bool CVideoMode::SetFullscreen(bool fullscreen)
|
|||
return false;
|
||||
|
||||
// Check whether this is actually a change
|
||||
if (fullscreen == m_IsFullscreen)
|
||||
if (fullscreen == IsInFullscreen())
|
||||
return true;
|
||||
|
||||
if (!m_IsFullscreen)
|
||||
if (!IsInFullscreen())
|
||||
{
|
||||
// Windowed -> fullscreen:
|
||||
|
||||
|
|
@ -860,12 +857,12 @@ bool CVideoMode::SetFullscreen(bool fullscreen)
|
|||
|
||||
bool CVideoMode::ToggleFullscreen()
|
||||
{
|
||||
return SetFullscreen(!m_IsFullscreen);
|
||||
return SetFullscreen(!IsInFullscreen());
|
||||
}
|
||||
|
||||
bool CVideoMode::IsInFullscreen() const
|
||||
{
|
||||
return m_IsFullscreen;
|
||||
return SDL_GetWindowFlags(m_Window) & (SDL_WINDOW_FULLSCREEN | SDL_WINDOW_FULLSCREEN_DESKTOP);
|
||||
}
|
||||
|
||||
void CVideoMode::UpdateRenderer(int w, int h)
|
||||
|
|
|
|||
|
|
@ -173,9 +173,6 @@ private:
|
|||
int m_WindowedX;
|
||||
int m_WindowedY;
|
||||
|
||||
// Whether we're currently being displayed fullscreen
|
||||
bool m_IsFullscreen = false;
|
||||
|
||||
// The last mode selected
|
||||
int m_CurrentW;
|
||||
int m_CurrentH;
|
||||
|
|
|
|||
Loading…
Reference in a new issue