SDL2: set relative mouse mode when grabbing the mouse

Reported-by: heftig <https://github.com/dxx-rebirth/dxx-rebirth/issues/397>
This commit is contained in:
Kp 2018-07-29 21:17:09 +00:00
parent c65020bf04
commit 25ab07bcc5

View file

@ -201,6 +201,7 @@ static void event_change_focus()
SDL_WM_GrabInput(enable_grab ? SDL_GRAB_ON : SDL_GRAB_OFF);
#elif SDL_MAJOR_VERSION == 2
SDL_SetWindowGrab(g_pRebirthSDLMainWindow, enable_grab ? SDL_TRUE : SDL_FALSE);
SDL_SetRelativeMouseMode(enable_grab ? SDL_TRUE : SDL_FALSE);
#endif
if (activate_focus)
mouse_disable_cursor();