Scroll to navigation

SDL_SetRelativeMouseMode(3) SDL3 FUNCTIONS SDL_SetRelativeMouseMode(3)

NAME

SDL_SetRelativeMouseMode - Set relative mouse mode.

SYNOPSIS

#include "SDL3/SDL.h"
int SDL_SetRelativeMouseMode(SDL_bool enabled);

DESCRIPTION

While the mouse is in relative mode, 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.

FUNCTION PARAMETERS

SDL_TRUE
to enable relative mode, SDL_FALSE
to disable.

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_GetRelativeMouseMode(3)

SDL 3.1.0 SDL