sdlGameControllerFromPlayerIndex function

Pointer<SdlGameController> sdlGameControllerFromPlayerIndex(
  1. int playerIndex
)

Get the SDL_GameController associated with a player index.

Please note that the player index is not the device index, nor is it the instance id!

\param player_index the player index, which is not the device index or the instance id! \returns the SDL_GameController associated with a player index.

\since This function is available since SDL 2.0.12.

\sa SDL_GameControllerGetPlayerIndex \sa SDL_GameControllerSetPlayerIndex

extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromPlayerIndex(int player_index)

Implementation

Pointer<SdlGameController> sdlGameControllerFromPlayerIndex(int playerIndex) {
  final sdlGameControllerFromPlayerIndexLookupFunction = libSdl2.lookupFunction<
      Pointer<SdlGameController> Function(Int32 playerIndex),
      Pointer<SdlGameController> Function(
          int playerIndex)>('SDL_GameControllerFromPlayerIndex');
  return sdlGameControllerFromPlayerIndexLookupFunction(playerIndex);
}