aboutsummaryrefslogtreecommitdiff
path: root/backends/platform
diff options
context:
space:
mode:
authorJohannes Schickel2013-10-21 01:03:29 +0200
committerJohannes Schickel2013-10-23 22:59:06 +0200
commitd34c9d5bcbbad9fdde59143d15d7e18bc82231c1 (patch)
treed4412f56a81d40818bb1f406ad69247f2044e950 /backends/platform
parenta9cb67df081cd8da44720d9c0b924ed22f7a38b7 (diff)
downloadscummvm-rg350-d34c9d5bcbbad9fdde59143d15d7e18bc82231c1.tar.gz
scummvm-rg350-d34c9d5bcbbad9fdde59143d15d7e18bc82231c1.tar.bz2
scummvm-rg350-d34c9d5bcbbad9fdde59143d15d7e18bc82231c1.zip
SDL: Do not require a static graphics mode list in OpenGL and SurfaceSDL.
Diffstat (limited to 'backends/platform')
-rw-r--r--backends/platform/sdl/sdl.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index 39865c85c6..327dfe21b9 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -651,21 +651,26 @@ void OSystem_SDL::setupGraphicsModes() {
_graphicsModes.clear();
_graphicsModeIds.clear();
- const OSystem::GraphicsMode *sdlGraphicsModes = SurfaceSdlGraphicsManager::supportedGraphicsModes();
- const OSystem::GraphicsMode *openglGraphicsModes = OpenGLSdlGraphicsManager::supportedGraphicsModes();
-
// Count the number of graphics modes
- const OSystem::GraphicsMode *srcMode = sdlGraphicsModes;
+ const OSystem::GraphicsMode *srcMode;
+
+ GraphicsManager *manager = new SurfaceSdlGraphicsManager(_eventSource);
+ srcMode = manager->getSupportedGraphicsModes();
while (srcMode->name) {
_graphicsModes.push_back(*srcMode);
srcMode++;
}
+ delete manager;
+
_firstGLMode = _graphicsModes.size();
- srcMode = openglGraphicsModes;
+ manager = new OpenGLSdlGraphicsManager(_desktopWidth, _desktopHeight, _eventSource);
+ srcMode = manager->getSupportedGraphicsModes();
while (srcMode->name) {
_graphicsModes.push_back(*srcMode);
srcMode++;
}
+ delete manager;
+ manager = nullptr;
// Set a null mode at the end
GraphicsMode nullMode;