OPENGLSDL: Always ignore bad resolution changes.

Otherwise we can end up with the wrong resolution when we make
multiple resizes in quick succession.
This commit is contained in:
Alyssa Milburn 2014-06-10 22:01:38 +02:00
parent 8ca3316e3a
commit 92e02457f5

View File

@ -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;
}