diff options
Diffstat (limited to 'backends/graphics/opengl')
-rw-r--r-- | backends/graphics/opengl/opengl-graphics.cpp | 21 | ||||
-rw-r--r-- | backends/graphics/opengl/opengl-graphics.h | 5 |
2 files changed, 26 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); diff --git a/backends/graphics/opengl/opengl-graphics.h b/backends/graphics/opengl/opengl-graphics.h index 31606cf336..c8b64fab89 100644 --- a/backends/graphics/opengl/opengl-graphics.h +++ b/backends/graphics/opengl/opengl-graphics.h @@ -176,6 +176,11 @@ protected: virtual void unloadGFXMode(); /** + * Setup the fullscreen mode state. + */ + void setFullscreenMode(bool enable); + + /** * Set the scale factor. * * This can only be used in a GFX transaction. |