sdlGetGamepadPlayerIndexForId function gamepad

int sdlGetGamepadPlayerIndexForId(
  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.

\threadsafety It is safe to call this function from any thread.

\since This function is available since SDL 3.2.0.

\sa SDL_GetGamepadPlayerIndex \sa SDL_GetGamepads

extern SDL_DECLSPEC int SDLCALL SDL_GetGamepadPlayerIndexForID(SDL_JoystickID instance_id)

Implementation

int sdlGetGamepadPlayerIndexForId(int instanceId) {
  final sdlGetGamepadPlayerIndexForIdLookupFunction = _libSdl
      .lookupFunction<
        Int32 Function(Uint32 instanceId),
        int Function(int instanceId)
      >('SDL_GetGamepadPlayerIndexForID');
  return sdlGetGamepadPlayerIndexForIdLookupFunction(instanceId);
}