sdlGamepadHasSensor function
Return whether a gamepad has a particular sensor.
\param gamepad the gamepad to query. \param type the type of sensor to query. \returns true if the sensor exists, false otherwise.
\since This function is available since SDL 3.1.3.
\sa SDL_GetGamepadSensorData \sa SDL_GetGamepadSensorDataRate \sa SDL_SetGamepadSensorEnabled
extern SDL_DECLSPEC bool SDLCALL SDL_GamepadHasSensor(SDL_Gamepad *gamepad, SDL_SensorType type)
Implementation
bool sdlGamepadHasSensor(Pointer<SdlGamepad> gamepad, int type) {
final sdlGamepadHasSensorLookupFunction = libSdl3.lookupFunction<
Uint8 Function(Pointer<SdlGamepad> gamepad, Int32 type),
int Function(
Pointer<SdlGamepad> gamepad, int type)>('SDL_GamepadHasSensor');
return sdlGamepadHasSensorLookupFunction(gamepad, type) == 1;
}