sdlGetJoystickPlayerIndexForId function

int sdlGetJoystickPlayerIndexForId(
  1. int instanceId
)

Get the player index of a joystick.

This can be called before any joysticks are opened.

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

\since This function is available since SDL 3.1.3.

\sa SDL_GetJoystickPlayerIndex \sa SDL_GetJoysticks

extern SDL_DECLSPEC int SDLCALL SDL_GetJoystickPlayerIndexForID(SDL_JoystickID instance_id)

Implementation

int sdlGetJoystickPlayerIndexForId(int instanceId) {
  final sdlGetJoystickPlayerIndexForIdLookupFunction = libSdl3.lookupFunction<
      Int32 Function(Uint32 instanceId),
      int Function(int instanceId)>('SDL_GetJoystickPlayerIndexForID');
  return sdlGetJoystickPlayerIndexForIdLookupFunction(instanceId);
}