sdlGamepadSensorEnabled function

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

Query whether sensor data reporting is enabled for a gamepad.

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

\since This function is available since SDL 3.1.3.

\sa SDL_SetGamepadSensorEnabled

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

Implementation

bool sdlGamepadSensorEnabled(Pointer<SdlGamepad> gamepad, int type) {
  final sdlGamepadSensorEnabledLookupFunction = libSdl3.lookupFunction<
      Uint8 Function(Pointer<SdlGamepad> gamepad, Int32 type),
      int Function(
          Pointer<SdlGamepad> gamepad, int type)>('SDL_GamepadSensorEnabled');
  return sdlGamepadSensorEnabledLookupFunction(gamepad, type) == 1;
}