SDL now represents gamepad buttons as positional elements with a separate label

This gives applications and binding systems a clearer view of what the hardware is so they can make intelligent decisions about how to present things to the user.

Gamepad mappings continue to use abxy for the face buttons for simplicity and compatibility with earlier versions of SDL, however the "SDL_GAMECONTROLLER_USE_BUTTON_LABELS" hint no longer has any effect.

Fixes https://github.com/libsdl-org/SDL/issues/6117
This commit is contained in:
Sam Lantinga
2023-11-06 13:07:12 -08:00
parent 8708ba7393
commit 2991b9f6ac
32 changed files with 852 additions and 611 deletions

View File

@@ -20,14 +20,6 @@ typedef enum
CONTROLLER_MODE_BINDING,
} ControllerDisplayMode;
typedef enum
{
GAMEPAD_IMAGE_FACE_BLANK,
GAMEPAD_IMAGE_FACE_ABXY,
GAMEPAD_IMAGE_FACE_BAYX,
GAMEPAD_IMAGE_FACE_SONY,
} GamepadImageFaceStyle;
enum
{
SDL_GAMEPAD_ELEMENT_INVALID = -1,
@@ -63,8 +55,8 @@ extern GamepadImage *CreateGamepadImage(SDL_Renderer *renderer);
extern void SetGamepadImagePosition(GamepadImage *ctx, int x, int y);
extern void GetGamepadImageArea(GamepadImage *ctx, SDL_Rect *area);
extern void SetGamepadImageShowingFront(GamepadImage *ctx, SDL_bool showing_front);
extern void SetGamepadImageFaceStyle(GamepadImage *ctx, GamepadImageFaceStyle face_style);
extern GamepadImageFaceStyle GetGamepadImageFaceStyle(GamepadImage *ctx);
extern void SetGamepadImageType(GamepadImage *ctx, SDL_GamepadType type);
extern SDL_GamepadType GetGamepadImageType(GamepadImage *ctx);
extern void SetGamepadImageDisplayMode(GamepadImage *ctx, ControllerDisplayMode display_mode);
extern int GetGamepadImageButtonWidth(GamepadImage *ctx);
extern int GetGamepadImageButtonHeight(GamepadImage *ctx);