aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics/openglsdl/openglsdl-graphics.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'backends/graphics/openglsdl/openglsdl-graphics.cpp')
-rw-r--r--backends/graphics/openglsdl/openglsdl-graphics.cpp49
1 files changed, 48 insertions, 1 deletions
diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp
index bd7dd32e3b..8828cb5f49 100644
--- a/backends/graphics/openglsdl/openglsdl-graphics.cpp
+++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp
@@ -30,8 +30,9 @@
#include "common/textconsole.h"
#include "common/translation.h"
-OpenGLSdlGraphicsManager::OpenGLSdlGraphicsManager()
+OpenGLSdlGraphicsManager::OpenGLSdlGraphicsManager(SdlEventSource *eventSource)
:
+ SdlGraphicsManager(eventSource),
_hwscreen(0),
_screenResized(false),
_activeFullscreenMode(-2),
@@ -655,4 +656,50 @@ bool OpenGLSdlGraphicsManager::notifyEvent(const Common::Event &event) {
return OpenGLGraphicsManager::notifyEvent(event);
}
+void OpenGLSdlGraphicsManager::notifyVideoExpose() {
+}
+
+void OpenGLSdlGraphicsManager::notifyResize(const uint width, const uint height) {
+ // Do not resize if ignoring resize events.
+ if (!_ignoreResizeFrames && !getFullscreenMode()) {
+ bool scaleChanged = false;
+ beginGFXTransaction();
+ _videoMode.hardwareWidth = width;
+ _videoMode.hardwareHeight = height;
+
+ if (_videoMode.mode != OpenGL::GFX_ORIGINAL) {
+ _screenResized = true;
+ calculateDisplaySize(_videoMode.hardwareWidth, _videoMode.hardwareHeight);
+ }
+
+ int scale = MIN(_videoMode.hardwareWidth / _videoMode.screenWidth,
+ _videoMode.hardwareHeight / _videoMode.screenHeight);
+
+ if (getScale() != scale) {
+ scaleChanged = true;
+ setScale(MAX(MIN(scale, 3), 1));
+ }
+
+ if (_videoMode.mode == OpenGL::GFX_ORIGINAL) {
+ calculateDisplaySize(_videoMode.hardwareWidth, _videoMode.hardwareHeight);
+ }
+
+ _transactionDetails.sizeChanged = true;
+ endGFXTransaction();
+#ifdef USE_OSD
+ if (scaleChanged)
+ displayScaleChangedMsg();
+#endif
+ }
+}
+
+void OpenGLSdlGraphicsManager::transformMouseCoordinates(Common::Point &point) {
+ adjustMousePosition(point.x, point.y);
+}
+
+void OpenGLSdlGraphicsManager::notifyMousePos(Common::Point mouse) {
+ _cursorState.x = mouse.x;
+ _cursorState.y = mouse.y;
+}
+
#endif