sdlGamepadHasAxis function gamepad
Query whether a gamepad has a given axis.
This merely reports whether the gamepad's mapping defined this axis, as that is all the information SDL has about the physical device.
\param gamepad a gamepad. \param axis an axis enum value (an SDL_GamepadAxis value). \returns true if the gamepad has this axis, 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_GamepadHasButton \sa SDL_GetGamepadAxis
extern SDL_DECLSPEC bool SDLCALL SDL_GamepadHasAxis(SDL_Gamepad *gamepad, SDL_GamepadAxis axis)
Implementation
bool sdlGamepadHasAxis(Pointer<SdlGamepad> gamepad, int axis) {
final sdlGamepadHasAxisLookupFunction = _libSdl
.lookupFunction<
Uint8 Function(Pointer<SdlGamepad> gamepad, Int32 axis),
int Function(Pointer<SdlGamepad> gamepad, int axis)
>('SDL_GamepadHasAxis');
return sdlGamepadHasAxisLookupFunction(gamepad, axis) == 1;
}