aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics/openglsdl/openglsdl-graphics.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2013-10-20 22:27:50 +0200
committerJohannes Schickel2013-10-23 22:58:34 +0200
commit6e46e9dfaf141fda10af798d9770b9f2b0555575 (patch)
treea60a0013d8f5aa11a6543947a0493405db0638bc /backends/graphics/openglsdl/openglsdl-graphics.cpp
parent18d2bbc2289feff265c12026aae7093b24aee959 (diff)
downloadscummvm-rg350-6e46e9dfaf141fda10af798d9770b9f2b0555575.tar.gz
scummvm-rg350-6e46e9dfaf141fda10af798d9770b9f2b0555575.tar.bz2
scummvm-rg350-6e46e9dfaf141fda10af798d9770b9f2b0555575.zip
SDL: Clean up graphics manager switching slighty.
Sadly this also requires us to extend GraphicsManager for this SDL specific feature. However, since that's only used in the SDL backend and Tizen it should be fine for now...
Diffstat (limited to 'backends/graphics/openglsdl/openglsdl-graphics.cpp')
-rw-r--r--backends/graphics/openglsdl/openglsdl-graphics.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp
index 925237b75e..088e97b1f7 100644
--- a/backends/graphics/openglsdl/openglsdl-graphics.cpp
+++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp
@@ -82,15 +82,24 @@ OpenGLSdlGraphicsManager::OpenGLSdlGraphicsManager(uint desktopWidth, uint deskt
}
OpenGLSdlGraphicsManager::~OpenGLSdlGraphicsManager() {
+}
+
+void OpenGLSdlGraphicsManager::activateManager() {
+ OpenGLGraphicsManager::activateManager();
+ initEventSource();
+
+ // Register the graphics manager as a event observer
+ g_system->getEventManager()->getEventDispatcher()->registerObserver(this, 10, false);
+}
+
+void OpenGLSdlGraphicsManager::deactivateManager() {
// Unregister the event observer
if (g_system->getEventManager()->getEventDispatcher()) {
g_system->getEventManager()->getEventDispatcher()->unregisterObserver(this);
}
-}
-void OpenGLSdlGraphicsManager::initEventObserver() {
- // Register the graphics manager as a event observer
- g_system->getEventManager()->getEventDispatcher()->registerObserver(this, 10, false);
+ deinitEventSource();
+ OpenGLGraphicsManager::deactivateManager();
}
bool OpenGLSdlGraphicsManager::hasFeature(OSystem::Feature f) {