sdlGetJoystickButton function
Get the current state of a button on a joystick.
\param joystick an SDL_Joystick structure containing joystick information. \param button the button index to get the state from; indices start at index 0. \returns true if the button is pressed, false otherwise.
\since This function is available since SDL 3.1.3.
\sa SDL_GetNumJoystickButtons
extern SDL_DECLSPEC bool SDLCALL SDL_GetJoystickButton(SDL_Joystick *joystick, int button)
Implementation
bool sdlGetJoystickButton(Pointer<SdlJoystick> joystick, int button) {
final sdlGetJoystickButtonLookupFunction = libSdl3.lookupFunction<
Uint8 Function(Pointer<SdlJoystick> joystick, Int32 button),
int Function(
Pointer<SdlJoystick> joystick, int button)>('SDL_GetJoystickButton');
return sdlGetJoystickButtonLookupFunction(joystick, button) == 1;
}