[Scummvm-cvs-logs] SF.net SVN: scummvm:[51560] scummvm/branches/gsoc2010-opengl/backends/ graphics/openglsdl
vgvgf at users.sourceforge.net
vgvgf at users.sourceforge.net
Sun Aug 1 01:50:54 CEST 2010
Revision: 51560
http://scummvm.svn.sourceforge.net/scummvm/?rev=51560&view=rev
Author: vgvgf
Date: 2010-07-31 23:50:54 +0000 (Sat, 31 Jul 2010)
Log Message:
-----------
OPENGL: Switch to native resolution fullscreen as default.
Modified Paths:
--------------
scummvm/branches/gsoc2010-opengl/backends/graphics/openglsdl/openglsdl-graphics.cpp
scummvm/branches/gsoc2010-opengl/backends/graphics/openglsdl/openglsdl-graphics.h
Modified: scummvm/branches/gsoc2010-opengl/backends/graphics/openglsdl/openglsdl-graphics.cpp
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/graphics/openglsdl/openglsdl-graphics.cpp 2010-07-31 22:54:10 UTC (rev 51559)
+++ scummvm/branches/gsoc2010-opengl/backends/graphics/openglsdl/openglsdl-graphics.cpp 2010-07-31 23:50:54 UTC (rev 51560)
@@ -40,6 +40,11 @@
// 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 @@
// 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)
Modified: scummvm/branches/gsoc2010-opengl/backends/graphics/openglsdl/openglsdl-graphics.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/graphics/openglsdl/openglsdl-graphics.h 2010-07-31 22:54:10 UTC (rev 51559)
+++ scummvm/branches/gsoc2010-opengl/backends/graphics/openglsdl/openglsdl-graphics.h 2010-07-31 23:50:54 UTC (rev 51560)
@@ -84,6 +84,9 @@
SDL_Surface *_hwscreen;
bool _screenResized;
+
+ int _desktopWidth;
+ int _desktopHeight;
};
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list