aboutsummaryrefslogtreecommitdiff
path: root/base/main.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2013-10-20 06:20:46 -0700
committerJohannes Schickel2013-10-20 06:20:46 -0700
commitf20471d9624cd73d0568560ffa76d1ff74e3cd8d (patch)
treebb09e2589aadc7e92a185a38b95d0b3365c42ef2 /base/main.cpp
parent4c3972d68a3a120bec6f7e327990949c82689792 (diff)
parent05c347fc8ad8edc990c9d6e7c15a12d93bd8a3a3 (diff)
downloadscummvm-rg350-f20471d9624cd73d0568560ffa76d1ff74e3cd8d.tar.gz
scummvm-rg350-f20471d9624cd73d0568560ffa76d1ff74e3cd8d.tar.bz2
scummvm-rg350-f20471d9624cd73d0568560ffa76d1ff74e3cd8d.zip
Merge pull request #408 from lordhoto/opengl-replacement
OpenGL revamp
Diffstat (limited to 'base/main.cpp')
-rw-r--r--base/main.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/base/main.cpp b/base/main.cpp
index 103d743bbc..c993dfa57a 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -134,6 +134,19 @@ static Common::Error runGame(const EnginePlugin *plugin, OSystem &system, const
Common::Error err = Common::kNoError;
Engine *engine = 0;
+#if defined(SDL_BACKEND) && defined(USE_OPENGL) && defined(USE_RGB_COLOR)
+ // HACK: We set up the requested graphics mode setting here to allow the
+ // backend to switch from Surface SDL to OpenGL if necessary. This is
+ // needed because otherwise the g_system->getSupportedFormats might return
+ // bad values.
+ g_system->beginGFXTransaction();
+ g_system->setGraphicsMode(ConfMan.get("gfx_mode").c_str());
+ if (g_system->endGFXTransaction() != OSystem::kTransactionSuccess) {
+ warning("Switching graphics mode to '%s' failed", ConfMan.get("gfx_mode").c_str());
+ return Common::kUnknownError;
+ }
+#endif
+
// Verify that the game path refers to an actual directory
if (!(dir.exists() && dir.isDirectory()))
err = Common::kPathNotDirectory;