From bd6f33380ecc8ab78012292e3a1b5ddb0c448c82 Mon Sep 17 00:00:00 2001 From: Jordi Vilalta Prat Date: Fri, 3 Dec 2010 19:09:27 +0000 Subject: OPENGL: Fix the fullscreen mode detection when SDL accepts any resolution. svn-id: r54754 --- backends/graphics/openglsdl/openglsdl-graphics.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'backends/graphics/openglsdl') diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp index f3aba1fcf4..b10c94b03f 100644 --- a/backends/graphics/openglsdl/openglsdl-graphics.cpp +++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp @@ -241,6 +241,15 @@ void OpenGLSdlGraphicsManager::updateScreen() { bool OpenGLSdlGraphicsManager::setupFullscreenMode() { SDL_Rect const* const*availableModes = SDL_ListModes(NULL, SDL_FULLSCREEN | SDL_OPENGL); + // SDL_ListModes() returns -1 in case any dimension is okay. In that + // case we'll reuse the current desktop resolution for fullscreen. + if (availableModes == (void *)-1) { + _videoMode.hardwareWidth = _desktopWidth; + _videoMode.hardwareHeight = _desktopHeight; + _videoMode.activeFullscreenMode = -2; + return true; + } + // If -2, autodetect the fullscreen mode // The last used fullscreen mode will be prioritized, if there is no last fullscreen // mode, the desktop resolution will be used, and in case the desktop resolution -- cgit v1.2.3