From 898773e12f7115e4f67b55c27fd87e2c796e598a Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 13 Dec 2015 23:47:52 +0100 Subject: 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. --- backends/graphics/openglsdl/openglsdl-graphics.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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 -- cgit v1.2.3