sdlGetGamepadButtonLabel function

int sdlGetGamepadButtonLabel(
  1. Pointer<SdlGamepad> gamepad,
  2. int button
)

Get the label of a button on a gamepad.

\param gamepad a gamepad. \param button a button index (one of the SDL_GamepadButton values). \returns the SDL_GamepadButtonLabel enum corresponding to the button label.

\since This function is available since SDL 3.1.3.

\sa SDL_GetGamepadButtonLabelForType

extern SDL_DECLSPEC SDL_GamepadButtonLabel SDLCALL SDL_GetGamepadButtonLabel(SDL_Gamepad *gamepad, SDL_GamepadButton button)

Implementation

int sdlGetGamepadButtonLabel(Pointer<SdlGamepad> gamepad, int button) {
  final sdlGetGamepadButtonLabelLookupFunction = libSdl3.lookupFunction<
      Int32 Function(Pointer<SdlGamepad> gamepad, Int32 button),
      int Function(Pointer<SdlGamepad> gamepad,
          int button)>('SDL_GetGamepadButtonLabel');
  return sdlGetGamepadButtonLabelLookupFunction(gamepad, button);
}