diff options
author | Johannes Schickel | 2011-03-17 20:27:00 +0100 |
---|---|---|
committer | Johannes Schickel | 2011-03-17 21:20:20 +0100 |
commit | 83b199e9212092bcc737e36eb3f0cff0666ddeac (patch) | |
tree | 19f5e4d856e8ccf58bdd94482b418e61582e3ba6 /backends/graphics/opengl/opengl-graphics.cpp | |
parent | 8d87a460b075793c3a06f5339eb5ee14c7498005 (diff) | |
download | scummvm-rg350-83b199e9212092bcc737e36eb3f0cff0666ddeac.tar.gz scummvm-rg350-83b199e9212092bcc737e36eb3f0cff0666ddeac.tar.bz2 scummvm-rg350-83b199e9212092bcc737e36eb3f0cff0666ddeac.zip |
OPENGL: Move setFullscreenMode to OpenGLGraphicsManager.
Diffstat (limited to 'backends/graphics/opengl/opengl-graphics.cpp')
-rw-r--r-- | backends/graphics/opengl/opengl-graphics.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp index 915a686285..0729ff331c 100644 --- a/backends/graphics/opengl/opengl-graphics.cpp +++ b/backends/graphics/opengl/opengl-graphics.cpp @@ -98,6 +98,10 @@ bool OpenGLGraphicsManager::hasFeature(OSystem::Feature f) { void OpenGLGraphicsManager::setFeatureState(OSystem::Feature f, bool enable) { switch (f) { + case OSystem::kFeatureFullscreenMode: + setFullscreenMode(enable); + break; + case OSystem::kFeatureAspectRatioCorrection: // TODO: If we enable aspect ratio correction, we automatically set // the video mode to 4/3. That is quity messy, but since we have that @@ -108,6 +112,7 @@ void OpenGLGraphicsManager::setFeatureState(OSystem::Feature f, bool enable) { if (enable) _videoMode.mode = OpenGL::GFX_4_3; break; + default: break; } @@ -115,8 +120,12 @@ void OpenGLGraphicsManager::setFeatureState(OSystem::Feature f, bool enable) { bool OpenGLGraphicsManager::getFeatureState(OSystem::Feature f) { switch (f) { + case OSystem::kFeatureFullscreenMode: + return _videoMode.fullscreen; + case OSystem::kFeatureAspectRatioCorrection: return _videoMode.mode == OpenGL::GFX_4_3; + default: return false; } @@ -677,6 +686,18 @@ void OpenGLGraphicsManager::displayMessageOnOSD(const char *msg) { // Intern // +void OpenGLGraphicsManager::setFullscreenMode(bool enable) { + assert(_transactionMode == kTransactionActive); + + if (_oldVideoMode.setup && _oldVideoMode.fullscreen == enable) + return; + + if (_transactionMode == kTransactionActive) { + _videoMode.fullscreen = enable; + _transactionDetails.needRefresh = true; + } +} + void OpenGLGraphicsManager::refreshGameScreen() { if (_screenNeedsRedraw) _screenDirtyRect = Common::Rect(0, 0, _screenData.w, _screenData.h); |