SDL_SetWindowMouseGrab(3)

NAME
SDL_SetWindowMouseGrab - Set a window's mouse grab mode.

HEADER FILE
Defined in SDL3/SDL_video.h

SYNOPSIS
#include "SDL3/SDL.h"

int SDL_SetWindowMouseGrab(SDL_Window *window, SDL_bool grabbed);

DESCRIPTION
Mouse grab confines the mouse cursor to the window.

FUNCTION PARAMETERS

window
    The window for which the mouse grab mode should be set.

grabbed
    This is SDL_TRUE
     to grab mouse, and SDL_FALSE
     to release.

RETURN VALUE
Returns 0 on success or a negative error code on failure; call SDL_GetError () for more information.

AVAILABILITY
This function is available since SDL 3.0.0.

SEE ALSO
SDL_GetWindowMouseGrab(3), SDL_SetWindowKeyboardGrab(3)