From 92e02457f59e30c0bedb9ae36cb02ba2e42e24bb Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Tue, 10 Jun 2014 22:01:38 +0200 Subject: OPENGLSDL: Always ignore bad resolution changes. Otherwise we can end up with the wrong resolution when we make multiple resizes in quick succession. --- backends/graphics/openglsdl/openglsdl-graphics.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp index 9540a19e9e..3f42d62a3a 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: @@ -359,6 +354,11 @@ bool OpenGLSdlGraphicsManager::setupMode(uint width, uint height) { setActualScreenSize(_hwScreen->w, _hwScreen->h); } + // Ignore resize events (from SDL) for a few frames. This avoids + // bad resizes to a (former) resolution for which we haven't + // processed an event yet. + _ignoreResizeEvents = 10; + return _hwScreen != nullptr; } -- cgit v1.2.3