Function SDL_GetGamepadPlayerIndexForID

pub unsafe extern "C" fn SDL_GetGamepadPlayerIndexForID(
    instance_id: u32,
) -> i32
Available on crate feature dep_sdl3 only.
Expand description

Get the player index of a gamepad.

This can be called before any gamepads are opened.

§Parameters

  • instance_id: the joystick instance ID.

§Return value

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

§Availability

This function is available since SDL 3.2.0.

§See also