SDL_GetGamepadPlayerIndex - Man Page

Get the player index of an opened gamepad.

Header File

Defined in SDL3/SDL_gamepad.h

Synopsis

#include "SDL3/SDL.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

·(3), SDL_SetGamepadPlayerIndex(3)

Referenced By

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

SDL 3.2.2 Simple Directmedia Layer SDL3 FUNCTIONS