diff options
Diffstat (limited to 'src/app/app.cpp')
-rw-r--r-- | src/app/app.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/app/app.cpp b/src/app/app.cpp index c703d7f..02da897 100644 --- a/src/app/app.cpp +++ b/src/app/app.cpp @@ -873,12 +873,13 @@ Event CApplication::ProcessSystemEvent() { event.type = EVENT_QUIT; } - else if ( m_private->currentEvent.type == SDL_VIDEORESIZE ) { - m_deviceConfig.size.x = m_private->currentEvent.resize.w; - m_deviceConfig.size.y = m_private->currentEvent.resize.h; - CreateVideoSurface(); - // FIXME: dirty hack, will fail with device other than OpenGL - dynamic_cast<Gfx::CGLDevice*>(m_device)->ResizeViewport(m_deviceConfig.size.x, m_deviceConfig.size.y); + else if (m_private->currentEvent.type == SDL_VIDEORESIZE) + { + Gfx::GLDeviceConfig newConfig = m_deviceConfig; + newConfig.size.x = m_private->currentEvent.resize.w; + newConfig.size.y = m_private->currentEvent.resize.h; + if (newConfig.size != m_deviceConfig.size) + ChangeVideoConfig(newConfig); } else if ( (m_private->currentEvent.type == SDL_KEYDOWN) || (m_private->currentEvent.type == SDL_KEYUP) ) |