sdlGetGamepadFromPlayerIndex function

Pointer<SdlGamepad> sdlGetGamepadFromPlayerIndex(
  1. int playerIndex
)

Get the SDL_Gamepad associated with a player index.

\param player_index the player index, which different from the instance ID. \returns the SDL_Gamepad associated with a player index.

\since This function is available since SDL 3.1.3.

\sa SDL_GetGamepadPlayerIndex \sa SDL_SetGamepadPlayerIndex

extern SDL_DECLSPEC SDL_Gamepad * SDLCALL SDL_GetGamepadFromPlayerIndex(int player_index)

Implementation

Pointer<SdlGamepad> sdlGetGamepadFromPlayerIndex(int playerIndex) {
  final sdlGetGamepadFromPlayerIndexLookupFunction = libSdl3.lookupFunction<
      Pointer<SdlGamepad> Function(Int32 playerIndex),
      Pointer<SdlGamepad> Function(
          int playerIndex)>('SDL_GetGamepadFromPlayerIndex');
  return sdlGetGamepadFromPlayerIndexLookupFunction(playerIndex);
}