aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics/openglsdl/openglsdl-graphics.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'backends/graphics/openglsdl/openglsdl-graphics.cpp')
-rw-r--r--backends/graphics/openglsdl/openglsdl-graphics.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp
index 3f9fc1fbd5..70190b4c63 100644
--- a/backends/graphics/openglsdl/openglsdl-graphics.cpp
+++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp
@@ -308,6 +308,14 @@ bool OpenGLSdlGraphicsManager::setupMode(uint width, uint height) {
flags |= SDL_RESIZABLE;
}
+ if (_hwScreen) {
+ // When a video mode has been setup already we notify the manager that
+ // the context is about to be destroyed.
+ // We do this because on Windows SDL_SetVideoMode can destroy and
+ // recreate the OpenGL context.
+ notifyContextDestroy();
+ }
+
_hwScreen = SDL_SetVideoMode(width, height, 32, flags);
if (!_hwScreen) {