getPlayerIndexForId static method

int getPlayerIndexForId(
  1. int instanceId
)

Get the player index of a gamepad.

This can be called before any gamepads are opened.

\param instance_id the joystick instance ID. \returns the player index of a gamepad, or -1 if it's not available.

\since This function is available since SDL 3.1.3.

\sa SDL_GetGamepadPlayerIndex \sa SDL_GetGamepads

extern SDL_DECLSPEC int SDLCALL SDL_GetGamepadPlayerIndexForID(SDL_JoystickID instance_id)

Implementation

static int getPlayerIndexForId(int instanceId) {
  return sdlGetGamepadPlayerIndexForId(instanceId);
}