aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backends/graphics/sdl/sdl-graphics.cpp22
-rw-r--r--backends/graphics/sdl/sdl-graphics.h3
2 files changed, 16 insertions, 9 deletions
diff --git a/backends/graphics/sdl/sdl-graphics.cpp b/backends/graphics/sdl/sdl-graphics.cpp
index 767ce24949..cf81e04f4d 100644
--- a/backends/graphics/sdl/sdl-graphics.cpp
+++ b/backends/graphics/sdl/sdl-graphics.cpp
@@ -314,15 +314,7 @@ bool SdlGraphicsManager::notifyEvent(const Common::Event &event) {
if (event.kbd.hasFlags(Common::KBD_ALT) &&
(event.kbd.keycode == Common::KEYCODE_RETURN ||
event.kbd.keycode == (Common::KeyCode)SDLK_KP_ENTER)) {
- beginGFXTransaction();
- setFeatureState(OSystem::kFeatureFullscreenMode, !getFeatureState(OSystem::kFeatureFullscreenMode));
- endGFXTransaction();
-#ifdef USE_OSD
- if (getFeatureState(OSystem::kFeatureFullscreenMode))
- displayMessageOnOSD(_("Fullscreen mode"));
- else
- displayMessageOnOSD(_("Windowed mode"));
-#endif
+ toggleFullScreen();
return true;
}
@@ -349,3 +341,15 @@ bool SdlGraphicsManager::notifyEvent(const Common::Event &event) {
return false;
}
+
+void SdlGraphicsManager::toggleFullScreen() {
+ beginGFXTransaction();
+ setFeatureState(OSystem::kFeatureFullscreenMode, !getFeatureState(OSystem::kFeatureFullscreenMode));
+ endGFXTransaction();
+#ifdef USE_OSD
+ if (getFeatureState(OSystem::kFeatureFullscreenMode))
+ displayMessageOnOSD(_("Fullscreen mode"));
+ else
+ displayMessageOnOSD(_("Windowed mode"));
+#endif
+}
diff --git a/backends/graphics/sdl/sdl-graphics.h b/backends/graphics/sdl/sdl-graphics.h
index d16402f57c..77c8d5d528 100644
--- a/backends/graphics/sdl/sdl-graphics.h
+++ b/backends/graphics/sdl/sdl-graphics.h
@@ -184,6 +184,9 @@ protected:
SDL_Surface *_hwScreen;
SdlEventSource *_eventSource;
SdlWindow *_window;
+
+private:
+ void toggleFullScreen();
};
#endif