diff options
Diffstat (limited to 'backends/graphics/openglsdl/openglsdl-graphics.cpp')
-rw-r--r-- | backends/graphics/openglsdl/openglsdl-graphics.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp index 9540a19e9e..c998f3d1f1 100644 --- a/backends/graphics/openglsdl/openglsdl-graphics.cpp +++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp @@ -104,11 +104,6 @@ void OpenGLSdlGraphicsManager::setFeatureState(OSystem::Feature f, bool enable) case OSystem::kFeatureFullscreenMode: assert(getTransactionMode() != kTransactionNone); _wantsFullScreen = enable; - // When we switch to windowed mode we will ignore resize events. This - // avoids bad resizes to the (former) fullscreen resolution. - if (!enable) { - _ignoreResizeEvents = 10; - } break; case OSystem::kFeatureIconifyWindow: @@ -316,7 +311,6 @@ bool OpenGLSdlGraphicsManager::setupMode(uint width, uint height) { SDL_Delay(10); } } - _lastVideoModeLoad = curTime; uint32 flags = SDL_OPENGL; if (_wantsFullScreen) { @@ -343,6 +337,9 @@ bool OpenGLSdlGraphicsManager::setupMode(uint width, uint height) { } } + // Part of the WORKAROUND mentioned above. + _lastVideoModeLoad = SDL_GetTicks(); + if (_hwScreen) { // This is pretty confusing since RGBA8888 talks about the memory // layout here. This is a different logical layout depending on @@ -359,6 +356,12 @@ bool OpenGLSdlGraphicsManager::setupMode(uint width, uint height) { setActualScreenSize(_hwScreen->w, _hwScreen->h); } + // Ignore resize events (from SDL) for a few frames, if this isn't + // caused by a notification from SDL. This avoids bad resizes to a + // (former) resolution for which we haven't processed an event yet. + if (!_gotResize) + _ignoreResizeEvents = 10; + return _hwScreen != nullptr; } |