diff options
author | Alejandro Marzini | 2010-07-31 23:50:54 +0000 |
---|---|---|
committer | Alejandro Marzini | 2010-07-31 23:50:54 +0000 |
commit | dd7bcc051f0dc04c7bd03bdceb89d8dc85c58c25 (patch) | |
tree | 07715a47c955d753198f93080dcd212432795e96 | |
parent | 7dbe257da8fcfd0996b21bdfe0d3851e3e2e1927 (diff) | |
download | scummvm-rg350-dd7bcc051f0dc04c7bd03bdceb89d8dc85c58c25.tar.gz scummvm-rg350-dd7bcc051f0dc04c7bd03bdceb89d8dc85c58c25.tar.bz2 scummvm-rg350-dd7bcc051f0dc04c7bd03bdceb89d8dc85c58c25.zip |
OPENGL: Switch to native resolution fullscreen as default.
svn-id: r51560
-rw-r--r-- | backends/graphics/openglsdl/openglsdl-graphics.cpp | 12 | ||||
-rw-r--r-- | backends/graphics/openglsdl/openglsdl-graphics.h | 3 |
2 files changed, 15 insertions, 0 deletions
diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp index d789e9f25b..1ac892b5b1 100644 --- a/backends/graphics/openglsdl/openglsdl-graphics.cpp +++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp @@ -40,6 +40,11 @@ OpenGLSdlGraphicsManager::OpenGLSdlGraphicsManager() // Disable OS cursor SDL_ShowCursor(SDL_DISABLE); + + // Get desktop resolution + const SDL_VideoInfo *videoInfo = SDL_GetVideoInfo(); + _desktopWidth = videoInfo->current_w; + _desktopHeight = videoInfo->current_h; } OpenGLSdlGraphicsManager::~OpenGLSdlGraphicsManager() { @@ -229,6 +234,13 @@ bool OpenGLSdlGraphicsManager::loadGFXMode() { // Iterate over all available fullscreen modes for (int i = 0; const SDL_Rect *mode = availableModes[i]; i++) { + // Prefer the native resolution over other modes + if(mode->w == _desktopWidth && mode->h == _desktopHeight) { + bestMode = mode; + bestModeIndex = i; + break; + } + if (mode->w < _videoMode.hardwareWidth) continue; if (mode->h < _videoMode.hardwareHeight) diff --git a/backends/graphics/openglsdl/openglsdl-graphics.h b/backends/graphics/openglsdl/openglsdl-graphics.h index 9b0a3df36f..144b961378 100644 --- a/backends/graphics/openglsdl/openglsdl-graphics.h +++ b/backends/graphics/openglsdl/openglsdl-graphics.h @@ -84,6 +84,9 @@ protected: SDL_Surface *_hwscreen; bool _screenResized; + + int _desktopWidth; + int _desktopHeight; }; #endif |