sdlIsGamepad function gamepad

bool sdlIsGamepad(
  1. int instanceId
)

Check if the given joystick is supported by the gamepad interface.

\param instance_id the joystick instance ID. \returns true if the given joystick is supported by the gamepad interface, false if it isn't or it's an invalid index.

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

\since This function is available since SDL 3.2.0.

\sa SDL_GetJoysticks \sa SDL_OpenGamepad

extern SDL_DECLSPEC bool SDLCALL SDL_IsGamepad(SDL_JoystickID instance_id)

Implementation

bool sdlIsGamepad(int instanceId) {
  final sdlIsGamepadLookupFunction = _libSdl
      .lookupFunction<
        Uint8 Function(Uint32 instanceId),
        int Function(int instanceId)
      >('SDL_IsGamepad');
  return sdlIsGamepadLookupFunction(instanceId) == 1;
}