diff --git a/src/Platform/Sdl2Application.cpp b/src/Platform/Sdl2Application.cpp index c5d030b20..59c2080f6 100644 --- a/src/Platform/Sdl2Application.cpp +++ b/src/Platform/Sdl2Application.cpp @@ -135,6 +135,11 @@ int Sdl2Application::exec() { return 0; } +void Sdl2Application::setMouseLocked(bool enabled) { + SDL_SetWindowGrab(window, enabled ? SDL_TRUE : SDL_FALSE); + SDL_SetRelativeMouseMode(enabled ? SDL_TRUE : SDL_FALSE); +} + Sdl2Application::InputEvent::Modifiers Sdl2Application::MouseEvent::modifiers() { if(modifiersLoaded) return _modifiers; modifiersLoaded = true; diff --git a/src/Platform/Sdl2Application.h b/src/Platform/Sdl2Application.h index b2ad3b4e6..996a780b8 100644 --- a/src/Platform/Sdl2Application.h +++ b/src/Platform/Sdl2Application.h @@ -135,9 +135,7 @@ class Sdl2Application { * MouseMoveEvent::relativePosition() is changing, absolute position * stays the same. */ - inline void setMouseLocked(bool enabled) { - SDL_SetRelativeMouseMode(enabled ? SDL_TRUE : SDL_FALSE); - } + void setMouseLocked(bool enabled); protected: /**