SDL: Send EVENT_SCREEN_CHANGED after receiving SDL_VIDEORESIZE when necessary.

This fixes some ugly crashes when resizing the window in OpenGL mode.
This commit is contained in:
Johannes Schickel 2013-10-17 23:53:51 +02:00
parent ed180f6b67
commit 53f9c0d69b

View File

@ -391,8 +391,17 @@ bool SdlEventSource::dispatchSDLEvent(SDL_Event &ev, Common::Event &event) {
return false;
case SDL_VIDEORESIZE:
if (_graphicsManager)
if (_graphicsManager) {
_graphicsManager->notifyResize(ev.resize.w, ev.resize.h);
// If the screen changed, send an Common::EVENT_SCREEN_CHANGED
int screenID = ((OSystem_SDL *)g_system)->getGraphicsManager()->getScreenChangeID();
if (screenID != _lastScreenID) {
_lastScreenID = screenID;
event.type = Common::EVENT_SCREEN_CHANGED;
return true;
}
}
return false;
case SDL_QUIT: