sdlGetGamepadId function

int sdlGetGamepadId(
  1. Pointer<SdlGamepad> gamepad
)

Get the instance ID of an opened gamepad.

\param gamepad a gamepad identifier previously returned by SDL_OpenGamepad(). \returns the instance ID of the specified gamepad on success or 0 on failure; call SDL_GetError() for more information.

\since This function is available since SDL 3.1.3.

extern SDL_DECLSPEC SDL_JoystickID SDLCALL SDL_GetGamepadID(SDL_Gamepad *gamepad)

Implementation

int sdlGetGamepadId(Pointer<SdlGamepad> gamepad) {
  final sdlGetGamepadIdLookupFunction = libSdl3.lookupFunction<
      Uint32 Function(Pointer<SdlGamepad> gamepad),
      int Function(Pointer<SdlGamepad> gamepad)>('SDL_GetGamepadID');
  return sdlGetGamepadIdLookupFunction(gamepad);
}