diff options
Diffstat (limited to 'backends/platform')
-rw-r--r-- | backends/platform/sdl/sdl.cpp | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index e36878db07..7b24ebe753 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -172,22 +172,6 @@ void OSystem_SDL::initBackend() { } } - // Creates the backend managers, if they don't exist yet (we check - // for this to allow subclasses to provide their own). - if (_eventManager == 0) - _eventManager = new DefaultEventManager(_eventSource); - - // We have to initialize the graphics manager before the event manager - // so the virtual keyboard can be initialized, but we have to add the - // graphics manager as an event observer after initializing the event - // manager. - if (graphicsManagerType == 0) - ((SdlGraphicsManager *)_graphicsManager)->initEventObserver(); -#ifdef USE_OPENGL - else if (graphicsManagerType == 1) - ((OpenGLSdlGraphicsManager *)_graphicsManager)->initEventObserver(); -#endif - if (_savefileManager == 0) _savefileManager = new DefaultSaveFileManager(); @@ -207,6 +191,18 @@ void OSystem_SDL::initBackend() { _inited = true; ModularBackend::initBackend(); + + // We have to initialize the graphics manager before the event manager + // so the virtual keyboard can be initialized, but we have to add the + // graphics manager as an event observer after initializing the event + // manager. + if (graphicsManagerType == 0) + ((SdlGraphicsManager *)_graphicsManager)->initEventObserver(); +#ifdef USE_OPENGL + else if (graphicsManagerType == 1) + ((OpenGLSdlGraphicsManager *)_graphicsManager)->initEventObserver(); +#endif + } void OSystem_SDL::initSDL() { |