diff options
Diffstat (limited to 'backends/platform')
-rw-r--r-- | backends/platform/sdl/sdl.cpp | 15 |
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; |