Function fermium::mouse::SDL_SetRelativeMouseMode[][src]

pub unsafe extern "C" fn SDL_SetRelativeMouseMode(
    enabled: SDL_bool
) -> c_int
Expand description

Set relative mouse mode.

  • enabled Whether or not to enable relative mode

Returns: 0 on success, or -1 if relative mode is not supported.

While the mouse is in relative mode, the cursor is hidden, and the driver will try to report continuous motion in the current window. Only relative motion events will be delivered, the mouse position will not change.

In other words, this is what you’d use for an “FPS” style interface.

Note: This function will flush any pending mouse motion.

See Also: SDL_GetRelativeMouseMode