Function SDL_GetGamepadPlayerIndex

pub unsafe extern "C" fn SDL_GetGamepadPlayerIndex(
    gamepad: *mut SDL_Gamepad,
) -> i32
Available on crate feature dep_sdl3 only.
Expand description

Get the player index of an opened gamepad.

For XInput gamepads this returns the XInput user index.

§Parameters

  • gamepad: the gamepad object to query.

§Return value

Returns the player index for gamepad, or -1 if it’s not available.

§Availability

This function is available since SDL 3.2.0.

§See also