sdlGamepadHasSensor function gamepad

bool sdlGamepadHasSensor(
  1. Pointer<SdlGamepad> gamepad,
  2. int type
)

Return whether a gamepad has a particular sensor.

Sensors are disabled by default and SDL_SetGamepadSensorEnabled() is used to enable them.

\param gamepad the gamepad to query. \param type the type of sensor to query. \returns true if the sensor exists, false otherwise.

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

\since This function is available since SDL 3.2.0.

\sa SDL_GetGamepadSensorData \sa SDL_GetGamepadSensorDataRate \sa SDL_SetGamepadSensorEnabled

extern SDL_DECLSPEC bool SDLCALL SDL_GamepadHasSensor(SDL_Gamepad *gamepad, SDL_SensorType type)

See also:

Implementation

bool sdlGamepadHasSensor(Pointer<SdlGamepad> gamepad, int type) {
  final sdlGamepadHasSensorLookupFunction = _libSdl
      .lookupFunction<
        Bool Function(Pointer<SdlGamepad> gamepad, Int32 type),
        bool Function(Pointer<SdlGamepad> gamepad, int type)
      >('SDL_GamepadHasSensor');
  return sdlGamepadHasSensorLookupFunction(gamepad, type);
}