SDL_GetGamepadPlayerIndex - Man Page

Get the player index of an opened gamepad.

Synopsis

#include <SDL3/SDL_gamepad.h>

int SDL_GetGamepadPlayerIndex(SDL_Gamepad *gamepad);

Description

For XInput gamepads this returns the XInput user index.

Function 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

SDL_SetGamepadPlayerIndex(3)

Referenced By

SDL_GetGamepadFromPlayerIndex(3), SDL_GetGamepadPlayerIndexForID(3), SDL_SetGamepadPlayerIndex(3).

SDL 3.2.16 Simple Directmedia Layer SDL3 FUNCTIONS