aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2014-02-11 11:07:37 +0100
committerJohannes Schickel2014-02-11 11:10:49 +0100
commitb5ca9f5f108ffd46a514656630c7ea9824a035ce (patch)
treedab7fe396a7256e48a450933d944afae089d312d
parent8be41e4f2ce353a97a2d41bee78cc99ca12b619a (diff)
downloadscummvm-rg350-b5ca9f5f108ffd46a514656630c7ea9824a035ce.tar.gz
scummvm-rg350-b5ca9f5f108ffd46a514656630c7ea9824a035ce.tar.bz2
scummvm-rg350-b5ca9f5f108ffd46a514656630c7ea9824a035ce.zip
OPENGLSDL: Notify OpenGL manager about context destruction.
-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) {