aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThierry Crozat2017-11-11 00:15:13 +0000
committerThierry Crozat2017-11-11 00:15:13 +0000
commit1d1f898c012902c719b9f31c2db39e6026b8af69 (patch)
tree7578afb0420abefbec9ff0a19843f909932eea92
parentb93fefebe8f449d7522047283bab163b8c91d8a4 (diff)
downloadscummvm-rg350-1d1f898c012902c719b9f31c2db39e6026b8af69.tar.gz
scummvm-rg350-1d1f898c012902c719b9f31c2db39e6026b8af69.tar.bz2
scummvm-rg350-1d1f898c012902c719b9f31c2db39e6026b8af69.zip
SDL: Preserve mouse position when switching between OpenGL and SurfaceSDL backends
Since those GraphcisManager initialize the cursor position to (0,0) when created the cursor was jumping to the top left corner and then moving back to its initial position as soon as the mouse was moved. Now it stays at its initial position. There are still some issues with it when changing between OpenGL and SurfaceSDL at the same time as toggling fullscreen. But it is not worse than before.
-rw-r--r--backends/graphics/sdl/sdl-graphics.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/backends/graphics/sdl/sdl-graphics.cpp b/backends/graphics/sdl/sdl-graphics.cpp
index f4aaa92955..864fc10099 100644
--- a/backends/graphics/sdl/sdl-graphics.cpp
+++ b/backends/graphics/sdl/sdl-graphics.cpp
@@ -32,7 +32,9 @@ SdlGraphicsManager::SdlGraphicsManager(SdlEventSource *source, SdlWindow *window
#if SDL_VERSION_ATLEAST(2, 0, 0)
, _allowWindowSizeReset(false), _hintedWidth(0), _hintedHeight(0), _lastFlags(0)
#endif
-{}
+{
+ SDL_GetMouseState(&_cursorX, &_cursorY);
+}
void SdlGraphicsManager::activateManager() {
_eventSource->setGraphicsManager(this);