sdlGetJoystickFromPlayerIndex function joystick

Pointer<SdlJoystick> sdlGetJoystickFromPlayerIndex(
  1. int playerIndex
)

Get the SDL_Joystick associated with a player index.

\param player_index the player index to get the SDL_Joystick for. \returns an SDL_Joystick on success or NULL on failure; call SDL_GetError() for more information.

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

\since This function is available since SDL 3.2.0.

\sa SDL_GetJoystickPlayerIndex \sa SDL_SetJoystickPlayerIndex

extern SDL_DECLSPEC SDL_Joystick * SDLCALL SDL_GetJoystickFromPlayerIndex(int player_index)

Implementation

Pointer<SdlJoystick> sdlGetJoystickFromPlayerIndex(int playerIndex) {
  final sdlGetJoystickFromPlayerIndexLookupFunction = _libSdl
      .lookupFunction<
        Pointer<SdlJoystick> Function(Int32 playerIndex),
        Pointer<SdlJoystick> Function(int playerIndex)
      >('SDL_GetJoystickFromPlayerIndex');
  return sdlGetJoystickFromPlayerIndexLookupFunction(playerIndex);
}