aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2015-12-13 23:47:52 +0100
committerJohannes Schickel2015-12-13 23:53:27 +0100
commit898773e12f7115e4f67b55c27fd87e2c796e598a (patch)
tree2089d3b23a7e2ff66ca90ea2b9a96d8273f13bff
parent1161e3e89d9c1d5aa72b184594d25411bc5ed472 (diff)
downloadscummvm-rg350-898773e12f7115e4f67b55c27fd87e2c796e598a.tar.gz
scummvm-rg350-898773e12f7115e4f67b55c27fd87e2c796e598a.tar.bz2
scummvm-rg350-898773e12f7115e4f67b55c27fd87e2c796e598a.zip
OPENGLSDL: Set proper mouse emulation dimensions.
Formerly we did not initialize the mouse emulation from SdlEventSource properly. Now hopefully joysticks etc. should work fine with the SDL OpenGL output too.
-rw-r--r--backends/graphics/openglsdl/openglsdl-graphics.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp
index 892dfc6cd3..0d140ee4d7 100644
--- a/backends/graphics/openglsdl/openglsdl-graphics.cpp
+++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp
@@ -21,6 +21,7 @@
*/
#include "backends/graphics/openglsdl/openglsdl-graphics.h"
+#include "backends/events/sdl/sdl-events.h"
#include "common/textconsole.h"
#include "common/config-manager.h"
@@ -244,6 +245,7 @@ void OpenGLSdlGraphicsManager::notifyVideoExpose() {
void OpenGLSdlGraphicsManager::notifyResize(const uint width, const uint height) {
#if SDL_VERSION_ATLEAST(2, 0, 0)
setActualScreenSize(width, height);
+ _eventSource->resetKeyboadEmulation(width - 1, height - 1);
#else
if (!_ignoreResizeEvents && _hwScreen && !(_hwScreen->flags & SDL_FULLSCREEN)) {
// We save that we handled a resize event here. We need to know this
@@ -404,6 +406,7 @@ bool OpenGLSdlGraphicsManager::setupMode(uint width, uint height) {
int actualWidth, actualHeight;
getWindowDimensions(&actualWidth, &actualHeight);
setActualScreenSize(actualWidth, actualHeight);
+ _eventSource->resetKeyboadEmulation(actualWidth - 1, actualHeight - 1);
return true;
#else
// WORKAROUND: Working around infamous SDL bugs when switching
@@ -449,6 +452,7 @@ bool OpenGLSdlGraphicsManager::setupMode(uint width, uint height) {
if (_hwScreen) {
notifyContextCreate(rgba8888, rgba8888);
setActualScreenSize(_hwScreen->w, _hwScreen->h);
+ _eventSource->resetKeyboadEmulation(_hwScreen->w - 1, _hwScreen->h - 1);
}
// Ignore resize events (from SDL) for a few frames, if this isn't