sdlJoystickHasSensor function joystick

bool sdlJoystickHasSensor(
  1. Pointer<SdlJoystick> joystick,
  2. int type
)

Return whether a joystick has a particular sensor.

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

\param joystick the joystick 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.6.0.

\sa SDL_GetJoystickSensorData \sa SDL_GetJoystickSensorDataRate \sa SDL_SetJoystickSensorEnabled

extern SDL_DECLSPEC bool SDLCALL SDL_JoystickHasSensor(SDL_Joystick *joystick, SDL_SensorType type)

See also:

Implementation

bool sdlJoystickHasSensor(Pointer<SdlJoystick> joystick, int type) {
  final sdlJoystickHasSensorLookupFunction = _libSdl
      .lookupFunction<
        Bool Function(Pointer<SdlJoystick> joystick, Int32 type),
        bool Function(Pointer<SdlJoystick> joystick, int type)
      >('SDL_JoystickHasSensor');
  return sdlJoystickHasSensorLookupFunction(joystick, type);
}