diff options
author | Johannes Schickel | 2013-08-19 00:54:41 +0200 |
---|---|---|
committer | Johannes Schickel | 2013-10-19 22:17:42 +0200 |
commit | 50a86463c1caf689922a72cfa6cece06c2ed3455 (patch) | |
tree | 34dcd6112a77bbfe458d8145bd70dda8654ce8e4 /backends/graphics | |
parent | cc9c991d7711ec08b7f06ca712cd7dfabe69f752 (diff) | |
download | scummvm-rg350-50a86463c1caf689922a72cfa6cece06c2ed3455.tar.gz scummvm-rg350-50a86463c1caf689922a72cfa6cece06c2ed3455.tar.bz2 scummvm-rg350-50a86463c1caf689922a72cfa6cece06c2ed3455.zip |
SDL: Use OSD in OpenGL SDL backend.
Diffstat (limited to 'backends/graphics')
-rw-r--r-- | backends/graphics/openglsdl/openglsdl-graphics.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp index ce6d7ec7f0..a1a3e8590a 100644 --- a/backends/graphics/openglsdl/openglsdl-graphics.cpp +++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp @@ -24,6 +24,9 @@ #include "common/textconsole.h" #include "common/config-manager.h" +#ifdef USE_OSD +#include "common/translation.h" +#endif OpenGLSdlGraphicsManager::OpenGLSdlGraphicsManager(uint desktopWidth, uint desktopHeight, SdlEventSource *eventSource) : SdlGraphicsManager(eventSource), _lastVideoModeLoad(0), _hwScreen(nullptr), _lastRequestedWidth(0), _lastRequestedHeight(0), @@ -342,6 +345,14 @@ bool OpenGLSdlGraphicsManager::notifyEvent(const Common::Event &event) { beginGFXTransaction(); setFeatureState(OSystem::kFeatureFullscreenMode, !getFeatureState(OSystem::kFeatureFullscreenMode)); endGFXTransaction(); + +#ifdef USE_OSD + if (getFeatureState(OSystem::kFeatureFullscreenMode)) { + displayMessageOnOSD("Fullscreen mode"); + } else { + displayMessageOnOSD("Windowed mode"); + } +#endif return true; } } else if (event.kbd.hasFlags(Common::KBD_CTRL | Common::KBD_ALT)) { @@ -407,6 +418,11 @@ bool OpenGLSdlGraphicsManager::notifyEvent(const Common::Event &event) { } } +#ifdef USE_OSD + const Common::String osdMsg = Common::String::format("Resolution: %dx%d", _hwScreen->w, _hwScreen->h); + displayMessageOnOSD(osdMsg.c_str()); +#endif + return true; } else if (event.kbd.keycode == Common::KEYCODE_a) { // In case the user changed the window size manually we will @@ -422,6 +438,12 @@ bool OpenGLSdlGraphicsManager::notifyEvent(const Common::Event &event) { // effectively checks whether loadVideoMode has been called. assert(!_ignoreLoadVideoMode); +#ifdef USE_OSD + Common::String osdMsg = "Aspect ratio correction: "; + osdMsg += getFeatureState(OSystem::kFeatureAspectRatioCorrection) ? "enabled" : "disabled"; + displayMessageOnOSD(osdMsg.c_str()); +#endif + return true; } else if (event.kbd.keycode == Common::KEYCODE_f) { // Ctrl+Alt+f toggles the graphics modes. @@ -462,6 +484,11 @@ bool OpenGLSdlGraphicsManager::notifyEvent(const Common::Event &event) { // effectively checks whether loadVideoMode has been called. assert(!_ignoreLoadVideoMode); +#ifdef USE_OSD + const Common::String osdMsg = Common::String::format("Graphics mode: %s", _(modeDesc->description)); + displayMessageOnOSD(osdMsg.c_str()); +#endif + return true; } } |