sdlGetGamepadId function gamepad

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.

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

\since This function is available since SDL 3.2.0.

extern SDL_DECLSPEC SDL_JoystickID SDLCALL SDL_GetGamepadID(SDL_Gamepad *gamepad)

Implementation

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