aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics
diff options
context:
space:
mode:
authorJordi Vilalta Prat2010-12-03 19:09:27 +0000
committerJordi Vilalta Prat2010-12-03 19:09:27 +0000
commitbd6f33380ecc8ab78012292e3a1b5ddb0c448c82 (patch)
treefc5432d29d16e72d4863cbdb5551c80596579f44 /backends/graphics
parent7f533ba2536beb4ac7215c6e051a28b8e0a9fb46 (diff)
downloadscummvm-rg350-bd6f33380ecc8ab78012292e3a1b5ddb0c448c82.tar.gz
scummvm-rg350-bd6f33380ecc8ab78012292e3a1b5ddb0c448c82.tar.bz2
scummvm-rg350-bd6f33380ecc8ab78012292e3a1b5ddb0c448c82.zip
OPENGL: Fix the fullscreen mode detection when SDL accepts any resolution.
svn-id: r54754
Diffstat (limited to 'backends/graphics')
-rw-r--r--backends/graphics/openglsdl/openglsdl-graphics.cpp9
1 files changed, 9 insertions, 0 deletions
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