Set relative mouse mode for a window.
Defined in <SDL3/SDL_mouse.h>
bool SDL_SetWindowRelativeMouseMode(SDL_Window *window, bool enabled);
SDL_Window * | window | the window to change. |
bool | enabled | true to enable relative mode, false to disable. |
(bool) Returns true on success or false on failure; call SDL_GetError() for more information.
While the window has focus and relative mouse mode is enabled, the cursor is hidden, the mouse position is constrained to the window, and SDL will report continuous relative mouse motion even if the mouse is at the edge of the window.
This function will flush any pending mouse motion for this window.
This function should only be called on the main thread.
This function is available since SDL 3.1.3.