diff options
author | Johannes Schickel | 2013-10-20 06:20:46 -0700 |
---|---|---|
committer | Johannes Schickel | 2013-10-20 06:20:46 -0700 |
commit | f20471d9624cd73d0568560ffa76d1ff74e3cd8d (patch) | |
tree | bb09e2589aadc7e92a185a38b95d0b3365c42ef2 /base/main.cpp | |
parent | 4c3972d68a3a120bec6f7e327990949c82689792 (diff) | |
parent | 05c347fc8ad8edc990c9d6e7c15a12d93bd8a3a3 (diff) | |
download | scummvm-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.cpp | 13 |
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; |