From b5ca9f5f108ffd46a514656630c7ea9824a035ce Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 11 Feb 2014 11:07:37 +0100 Subject: OPENGLSDL: Notify OpenGL manager about context destruction. --- backends/graphics/openglsdl/openglsdl-graphics.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'backends') 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) { -- cgit v1.2.3