forked from Green-Sky/tomato
sdl (master post 3.1 preview) Merge commit 'e4f454091a943345938608570b104400f62fd625'
This commit is contained in:
184
external/sdl/SDL/include/SDL3/SDL_gamepad.h
vendored
184
external/sdl/SDL/include/SDL3/SDL_gamepad.h
vendored
@@ -32,7 +32,7 @@
|
||||
#include <SDL3/SDL_error.h>
|
||||
#include <SDL3/SDL_joystick.h>
|
||||
#include <SDL3/SDL_properties.h>
|
||||
#include <SDL3/SDL_rwops.h>
|
||||
#include <SDL3/SDL_iostream.h>
|
||||
#include <SDL3/SDL_sensor.h>
|
||||
|
||||
#include <SDL3/SDL_begin_code.h>
|
||||
@@ -113,12 +113,17 @@ typedef enum
|
||||
SDL_GAMEPAD_BUTTON_DPAD_DOWN,
|
||||
SDL_GAMEPAD_BUTTON_DPAD_LEFT,
|
||||
SDL_GAMEPAD_BUTTON_DPAD_RIGHT,
|
||||
SDL_GAMEPAD_BUTTON_MISC1, /* Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button) */
|
||||
SDL_GAMEPAD_BUTTON_MISC1, /* Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button, Google Stadia capture button) */
|
||||
SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1, /* Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1) */
|
||||
SDL_GAMEPAD_BUTTON_LEFT_PADDLE1, /* Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3) */
|
||||
SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2, /* Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2) */
|
||||
SDL_GAMEPAD_BUTTON_LEFT_PADDLE2, /* Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4) */
|
||||
SDL_GAMEPAD_BUTTON_TOUCHPAD, /* PS4/PS5 touchpad button */
|
||||
SDL_GAMEPAD_BUTTON_MISC2, /* Additional button */
|
||||
SDL_GAMEPAD_BUTTON_MISC3, /* Additional button */
|
||||
SDL_GAMEPAD_BUTTON_MISC4, /* Additional button */
|
||||
SDL_GAMEPAD_BUTTON_MISC5, /* Additional button */
|
||||
SDL_GAMEPAD_BUTTON_MISC6, /* Additional button */
|
||||
SDL_GAMEPAD_BUTTON_MAX
|
||||
} SDL_GamepadButton;
|
||||
|
||||
@@ -173,9 +178,9 @@ typedef enum
|
||||
SDL_GAMEPAD_BINDTYPE_HAT
|
||||
} SDL_GamepadBindingType;
|
||||
|
||||
typedef struct
|
||||
typedef struct SDL_GamepadBinding
|
||||
{
|
||||
SDL_GamepadBindingType inputType;
|
||||
SDL_GamepadBindingType input_type;
|
||||
union
|
||||
{
|
||||
int button;
|
||||
@@ -195,7 +200,7 @@ typedef struct
|
||||
|
||||
} input;
|
||||
|
||||
SDL_GamepadBindingType outputType;
|
||||
SDL_GamepadBindingType output_type;
|
||||
union
|
||||
{
|
||||
SDL_GamepadButton button;
|
||||
@@ -246,7 +251,7 @@ typedef struct
|
||||
extern DECLSPEC int SDLCALL SDL_AddGamepadMapping(const char *mapping);
|
||||
|
||||
/**
|
||||
* Load a set of gamepad mappings from a seekable SDL data stream.
|
||||
* Load a set of gamepad mappings from an SDL_IOStream.
|
||||
*
|
||||
* You can call this function several times, if needed, to load different
|
||||
* database files.
|
||||
@@ -263,7 +268,7 @@ extern DECLSPEC int SDLCALL SDL_AddGamepadMapping(const char *mapping);
|
||||
* constrained environment.
|
||||
*
|
||||
* \param src the data stream for the mappings to be added
|
||||
* \param freesrc if SDL_TRUE, calls SDL_RWclose() on `src` before returning,
|
||||
* \param closeio if SDL_TRUE, calls SDL_CloseIO() on `src` before returning,
|
||||
* even in the case of an error
|
||||
* \returns the number of mappings added or -1 on error; call SDL_GetError()
|
||||
* for more information.
|
||||
@@ -272,9 +277,10 @@ extern DECLSPEC int SDLCALL SDL_AddGamepadMapping(const char *mapping);
|
||||
*
|
||||
* \sa SDL_AddGamepadMapping
|
||||
* \sa SDL_AddGamepadMappingsFromFile
|
||||
* \sa SDL_GetGamepadMapping
|
||||
* \sa SDL_GetGamepadMappingForGUID
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_AddGamepadMappingsFromRW(SDL_RWops *src, SDL_bool freesrc);
|
||||
extern DECLSPEC int SDLCALL SDL_AddGamepadMappingsFromIO(SDL_IOStream *src, SDL_bool closeio);
|
||||
|
||||
/**
|
||||
* Load a set of gamepad mappings from a file.
|
||||
@@ -296,7 +302,8 @@ extern DECLSPEC int SDLCALL SDL_AddGamepadMappingsFromRW(SDL_RWops *src, SDL_boo
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_AddGamepadMapping
|
||||
* \sa SDL_AddGamepadMappingsFromRW
|
||||
* \sa SDL_AddGamepadMappingsFromIO
|
||||
* \sa SDL_GetGamepadMapping
|
||||
* \sa SDL_GetGamepadMappingForGUID
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_AddGamepadMappingsFromFile(const char *file);
|
||||
@@ -314,7 +321,7 @@ extern DECLSPEC int SDLCALL SDL_AddGamepadMappingsFromFile(const char *file);
|
||||
extern DECLSPEC int SDLCALL SDL_ReloadGamepadMappings(void);
|
||||
|
||||
/**
|
||||
* Get the mapping at a particular index.
|
||||
* Get the current gamepad mappings.
|
||||
*
|
||||
* You must free the returned pointer with SDL_free() when you are done with
|
||||
* it, but you do _not_ free each string in the array.
|
||||
@@ -358,6 +365,7 @@ extern DECLSPEC char * SDLCALL SDL_GetGamepadMappingForGUID(SDL_JoystickGUID gui
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_AddGamepadMapping
|
||||
* \sa SDL_GetGamepadInstanceMapping
|
||||
* \sa SDL_GetGamepadMappingForGUID
|
||||
* \sa SDL_SetGamepadMapping
|
||||
*/
|
||||
@@ -381,6 +389,17 @@ extern DECLSPEC char * SDLCALL SDL_GetGamepadMapping(SDL_Gamepad *gamepad);
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetGamepadMapping(SDL_JoystickID instance_id, const char *mapping);
|
||||
|
||||
/**
|
||||
* Return whether a gamepad is currently connected.
|
||||
*
|
||||
* \returns SDL_TRUE if a gamepad is connected, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepads
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasGamepad(void);
|
||||
|
||||
/**
|
||||
* Get a list of currently connected gamepads.
|
||||
*
|
||||
@@ -391,6 +410,7 @@ extern DECLSPEC int SDLCALL SDL_SetGamepadMapping(SDL_JoystickID instance_id, co
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HasGamepad
|
||||
* \sa SDL_OpenGamepad
|
||||
*/
|
||||
extern DECLSPEC SDL_JoystickID *SDLCALL SDL_GetGamepads(int *count);
|
||||
@@ -404,6 +424,7 @@ extern DECLSPEC SDL_JoystickID *SDLCALL SDL_GetGamepads(int *count);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetJoysticks
|
||||
* \sa SDL_OpenGamepad
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_IsGamepad(SDL_JoystickID instance_id);
|
||||
@@ -420,7 +441,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsGamepad(SDL_JoystickID instance_id);
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepadName
|
||||
* \sa SDL_OpenGamepad
|
||||
* \sa SDL_GetGamepads
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetGamepadInstanceName(SDL_JoystickID instance_id);
|
||||
|
||||
@@ -436,7 +457,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetGamepadInstanceName(SDL_JoystickID in
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepadPath
|
||||
* \sa SDL_OpenGamepad
|
||||
* \sa SDL_GetGamepads
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetGamepadInstancePath(SDL_JoystickID instance_id);
|
||||
|
||||
@@ -451,7 +472,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetGamepadInstancePath(SDL_JoystickID in
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepadPlayerIndex
|
||||
* \sa SDL_OpenGamepad
|
||||
* \sa SDL_GetGamepads
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetGamepadInstancePlayerIndex(SDL_JoystickID instance_id);
|
||||
|
||||
@@ -468,6 +489,7 @@ extern DECLSPEC int SDLCALL SDL_GetGamepadInstancePlayerIndex(SDL_JoystickID ins
|
||||
*
|
||||
* \sa SDL_GetGamepadGUID
|
||||
* \sa SDL_GetGamepadGUIDString
|
||||
* \sa SDL_GetGamepads
|
||||
*/
|
||||
extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetGamepadInstanceGUID(SDL_JoystickID instance_id);
|
||||
|
||||
@@ -482,6 +504,9 @@ extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetGamepadInstanceGUID(SDL_Joystick
|
||||
* index, this function returns zero
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepadVendor
|
||||
* \sa SDL_GetGamepads
|
||||
*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadInstanceVendor(SDL_JoystickID instance_id);
|
||||
|
||||
@@ -496,6 +521,9 @@ extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadInstanceVendor(SDL_JoystickID insta
|
||||
* invalid index, this function returns zero
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepadProduct
|
||||
* \sa SDL_GetGamepads
|
||||
*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadInstanceProduct(SDL_JoystickID instance_id);
|
||||
|
||||
@@ -510,6 +538,9 @@ extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadInstanceProduct(SDL_JoystickID inst
|
||||
* invalid index, this function returns zero
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepadProductVersion
|
||||
* \sa SDL_GetGamepads
|
||||
*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadInstanceProductVersion(SDL_JoystickID instance_id);
|
||||
|
||||
@@ -522,6 +553,10 @@ extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadInstanceProductVersion(SDL_Joystick
|
||||
* \returns the gamepad type.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepadType
|
||||
* \sa SDL_GetGamepads
|
||||
* \sa SDL_GetRealGamepadInstanceType
|
||||
*/
|
||||
extern DECLSPEC SDL_GamepadType SDLCALL SDL_GetGamepadInstanceType(SDL_JoystickID instance_id);
|
||||
|
||||
@@ -534,6 +569,10 @@ extern DECLSPEC SDL_GamepadType SDLCALL SDL_GetGamepadInstanceType(SDL_JoystickI
|
||||
* \returns the gamepad type.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepadInstanceType
|
||||
* \sa SDL_GetGamepads
|
||||
* \sa SDL_GetRealGamepadType
|
||||
*/
|
||||
extern DECLSPEC SDL_GamepadType SDLCALL SDL_GetRealGamepadInstanceType(SDL_JoystickID instance_id);
|
||||
|
||||
@@ -547,6 +586,9 @@ extern DECLSPEC SDL_GamepadType SDLCALL SDL_GetRealGamepadInstanceType(SDL_Joyst
|
||||
* no mapping is available.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepads
|
||||
* \sa SDL_GetGamepadMapping
|
||||
*/
|
||||
extern DECLSPEC char *SDLCALL SDL_GetGamepadInstanceMapping(SDL_JoystickID instance_id);
|
||||
|
||||
@@ -594,6 +636,19 @@ extern DECLSPEC SDL_Gamepad *SDLCALL SDL_GetGamepadFromPlayerIndex(int player_in
|
||||
*
|
||||
* These properties are shared with the underlying joystick object.
|
||||
*
|
||||
* The following read-only properties are provided by SDL:
|
||||
*
|
||||
* - `SDL_PROP_GAMEPAD_CAP_MONO_LED_BOOLEAN`: true if this gamepad has an LED
|
||||
* that has adjustable brightness
|
||||
* - `SDL_PROP_GAMEPAD_CAP_RGB_LED_BOOLEAN`: true if this gamepad has an LED
|
||||
* that has adjustable color
|
||||
* - `SDL_PROP_GAMEPAD_CAP_PLAYER_LED_BOOLEAN`: true if this gamepad has a
|
||||
* player LED
|
||||
* - `SDL_PROP_GAMEPAD_CAP_RUMBLE_BOOLEAN`: true if this gamepad has
|
||||
* left/right rumble
|
||||
* - `SDL_PROP_GAMEPAD_CAP_TRIGGER_RUMBLE_BOOLEAN`: true if this gamepad has
|
||||
* simple trigger rumble
|
||||
*
|
||||
* \param gamepad a gamepad identifier previously returned by
|
||||
* SDL_OpenGamepad()
|
||||
* \returns a valid property ID on success or 0 on failure; call
|
||||
@@ -606,6 +661,12 @@ extern DECLSPEC SDL_Gamepad *SDLCALL SDL_GetGamepadFromPlayerIndex(int player_in
|
||||
*/
|
||||
extern DECLSPEC SDL_PropertiesID SDLCALL SDL_GetGamepadProperties(SDL_Gamepad *gamepad);
|
||||
|
||||
#define SDL_PROP_GAMEPAD_CAP_MONO_LED_BOOLEAN SDL_PROP_JOYSTICK_CAP_MONO_LED_BOOLEAN
|
||||
#define SDL_PROP_GAMEPAD_CAP_RGB_LED_BOOLEAN SDL_PROP_JOYSTICK_CAP_RGB_LED_BOOLEAN
|
||||
#define SDL_PROP_GAMEPAD_CAP_PLAYER_LED_BOOLEAN SDL_PROP_JOYSTICK_CAP_PLAYER_LED_BOOLEAN
|
||||
#define SDL_PROP_GAMEPAD_CAP_RUMBLE_BOOLEAN SDL_PROP_JOYSTICK_CAP_RUMBLE_BOOLEAN
|
||||
#define SDL_PROP_GAMEPAD_CAP_TRIGGER_RUMBLE_BOOLEAN SDL_PROP_JOYSTICK_CAP_TRIGGER_RUMBLE_BOOLEAN
|
||||
|
||||
/**
|
||||
* Get the instance ID of an opened gamepad.
|
||||
*
|
||||
@@ -615,8 +676,6 @@ extern DECLSPEC SDL_PropertiesID SDLCALL SDL_GetGamepadProperties(SDL_Gamepad *g
|
||||
* failure; call SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_OpenGamepad
|
||||
*/
|
||||
extern DECLSPEC SDL_JoystickID SDLCALL SDL_GetGamepadInstanceID(SDL_Gamepad *gamepad);
|
||||
|
||||
@@ -631,7 +690,6 @@ extern DECLSPEC SDL_JoystickID SDLCALL SDL_GetGamepadInstanceID(SDL_Gamepad *gam
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepadInstanceName
|
||||
* \sa SDL_OpenGamepad
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetGamepadName(SDL_Gamepad *gamepad);
|
||||
|
||||
@@ -684,6 +742,8 @@ extern DECLSPEC SDL_GamepadType SDLCALL SDL_GetRealGamepadType(SDL_Gamepad *game
|
||||
* \returns the player index for gamepad, or -1 if it's not available.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_SetGamepadPlayerIndex
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetGamepadPlayerIndex(SDL_Gamepad *gamepad);
|
||||
|
||||
@@ -697,6 +757,8 @@ extern DECLSPEC int SDLCALL SDL_GetGamepadPlayerIndex(SDL_Gamepad *gamepad);
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepadPlayerIndex
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetGamepadPlayerIndex(SDL_Gamepad *gamepad, int player_index);
|
||||
|
||||
@@ -709,6 +771,8 @@ extern DECLSPEC int SDLCALL SDL_SetGamepadPlayerIndex(SDL_Gamepad *gamepad, int
|
||||
* \returns the USB vendor ID, or zero if unavailable.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepadInstanceVendor
|
||||
*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadVendor(SDL_Gamepad *gamepad);
|
||||
|
||||
@@ -721,6 +785,8 @@ extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadVendor(SDL_Gamepad *gamepad);
|
||||
* \returns the USB product ID, or zero if unavailable.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepadInstanceProduct
|
||||
*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadProduct(SDL_Gamepad *gamepad);
|
||||
|
||||
@@ -733,6 +799,8 @@ extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadProduct(SDL_Gamepad *gamepad);
|
||||
* \returns the USB product version, or zero if unavailable.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepadInstanceProductVersion
|
||||
*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadProductVersion(SDL_Gamepad *gamepad);
|
||||
|
||||
@@ -794,9 +862,6 @@ extern DECLSPEC SDL_JoystickPowerLevel SDLCALL SDL_GetGamepadPowerLevel(SDL_Game
|
||||
* connected, or SDL_FALSE if not.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CloseGamepad
|
||||
* \sa SDL_OpenGamepad
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GamepadConnected(SDL_Gamepad *gamepad);
|
||||
|
||||
@@ -830,6 +895,7 @@ extern DECLSPEC SDL_Joystick *SDLCALL SDL_GetGamepadJoystick(SDL_Gamepad *gamepa
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GamepadEventsEnabled
|
||||
* \sa SDL_UpdateGamepads
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_SetGamepadEventsEnabled(SDL_bool enabled);
|
||||
|
||||
@@ -942,7 +1008,7 @@ extern DECLSPEC SDL_GamepadAxis SDLCALL SDL_GetGamepadAxisFromString(const char
|
||||
*
|
||||
* \sa SDL_GetGamepadAxisFromString
|
||||
*/
|
||||
extern DECLSPEC const char* SDLCALL SDL_GetGamepadStringForAxis(SDL_GamepadAxis axis);
|
||||
extern DECLSPEC const char * SDLCALL SDL_GetGamepadStringForAxis(SDL_GamepadAxis axis);
|
||||
|
||||
/**
|
||||
* Query whether a gamepad has a given axis.
|
||||
@@ -955,6 +1021,9 @@ extern DECLSPEC const char* SDLCALL SDL_GetGamepadStringForAxis(SDL_GamepadAxis
|
||||
* \returns SDL_TRUE if the gamepad has this axis, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GamepadHasButton
|
||||
* \sa SDL_GetGamepadAxis
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GamepadHasAxis(SDL_Gamepad *gamepad, SDL_GamepadAxis axis);
|
||||
|
||||
@@ -977,6 +1046,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GamepadHasAxis(SDL_Gamepad *gamepad, SDL_Ga
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GamepadHasAxis
|
||||
* \sa SDL_GetGamepadButton
|
||||
*/
|
||||
extern DECLSPEC Sint16 SDLCALL SDL_GetGamepadAxis(SDL_Gamepad *gamepad, SDL_GamepadAxis axis);
|
||||
@@ -994,6 +1064,8 @@ extern DECLSPEC Sint16 SDLCALL SDL_GetGamepadAxis(SDL_Gamepad *gamepad, SDL_Game
|
||||
* `SDL_GAMEPAD_BUTTON_INVALID` if no match was found.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepadStringForButton
|
||||
*/
|
||||
extern DECLSPEC SDL_GamepadButton SDLCALL SDL_GetGamepadButtonFromString(const char *str);
|
||||
|
||||
@@ -1024,6 +1096,8 @@ extern DECLSPEC const char* SDLCALL SDL_GetGamepadStringForButton(SDL_GamepadBut
|
||||
* \returns SDL_TRUE if the gamepad has this button, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GamepadHasAxis
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GamepadHasButton(SDL_Gamepad *gamepad, SDL_GamepadButton button);
|
||||
|
||||
@@ -1037,6 +1111,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GamepadHasButton(SDL_Gamepad *gamepad, SDL_
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GamepadHasButton
|
||||
* \sa SDL_GetGamepadAxis
|
||||
*/
|
||||
extern DECLSPEC Uint8 SDLCALL SDL_GetGamepadButton(SDL_Gamepad *gamepad, SDL_GamepadButton button);
|
||||
@@ -1074,6 +1149,8 @@ extern DECLSPEC SDL_GamepadButtonLabel SDLCALL SDL_GetGamepadButtonLabel(SDL_Gam
|
||||
* \returns number of touchpads
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetNumGamepadTouchpadFingers
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetNumGamepadTouchpads(SDL_Gamepad *gamepad);
|
||||
|
||||
@@ -1086,6 +1163,9 @@ extern DECLSPEC int SDLCALL SDL_GetNumGamepadTouchpads(SDL_Gamepad *gamepad);
|
||||
* \returns number of supported simultaneous fingers
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepadTouchpadFinger
|
||||
* \sa SDL_GetNumGamepadTouchpads
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetNumGamepadTouchpadFingers(SDL_Gamepad *gamepad, int touchpad);
|
||||
|
||||
@@ -1103,6 +1183,8 @@ extern DECLSPEC int SDLCALL SDL_GetNumGamepadTouchpadFingers(SDL_Gamepad *gamepa
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetNumGamepadTouchpadFingers
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetGamepadTouchpadFinger(SDL_Gamepad *gamepad, int touchpad, int finger, Uint8 *state, float *x, float *y, float *pressure);
|
||||
|
||||
@@ -1114,6 +1196,10 @@ extern DECLSPEC int SDLCALL SDL_GetGamepadTouchpadFinger(SDL_Gamepad *gamepad, i
|
||||
* \returns SDL_TRUE if the sensor exists, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepadSensorData
|
||||
* \sa SDL_GetGamepadSensorDataRate
|
||||
* \sa SDL_SetGamepadSensorEnabled
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GamepadHasSensor(SDL_Gamepad *gamepad, SDL_SensorType type);
|
||||
|
||||
@@ -1127,6 +1213,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GamepadHasSensor(SDL_Gamepad *gamepad, SDL_
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GamepadHasSensor
|
||||
* \sa SDL_GamepadSensorEnabled
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetGamepadSensorEnabled(SDL_Gamepad *gamepad, SDL_SensorType type, SDL_bool enabled);
|
||||
|
||||
@@ -1138,6 +1227,8 @@ extern DECLSPEC int SDLCALL SDL_SetGamepadSensorEnabled(SDL_Gamepad *gamepad, SD
|
||||
* \returns SDL_TRUE if the sensor is enabled, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_SetGamepadSensorEnabled
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GamepadSensorEnabled(SDL_Gamepad *gamepad, SDL_SensorType type);
|
||||
|
||||
@@ -1175,6 +1266,9 @@ extern DECLSPEC int SDLCALL SDL_GetGamepadSensorData(SDL_Gamepad *gamepad, SDL_S
|
||||
* Each call to this function cancels any previous rumble effect, and calling
|
||||
* it with 0 intensity stops any rumbling.
|
||||
*
|
||||
* This function requires you to process SDL events or call
|
||||
* SDL_UpdateJoysticks() to update rumble state.
|
||||
*
|
||||
* \param gamepad The gamepad to vibrate
|
||||
* \param low_frequency_rumble The intensity of the low frequency (left)
|
||||
* rumble motor, from 0 to 0xFFFF
|
||||
@@ -1184,8 +1278,6 @@ extern DECLSPEC int SDLCALL SDL_GetGamepadSensorData(SDL_Gamepad *gamepad, SDL_S
|
||||
* \returns 0, or -1 if rumble isn't supported on this gamepad
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GamepadHasRumble
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_RumbleGamepad(SDL_Gamepad *gamepad, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms);
|
||||
|
||||
@@ -1199,6 +1291,9 @@ extern DECLSPEC int SDLCALL SDL_RumbleGamepad(SDL_Gamepad *gamepad, Uint16 low_f
|
||||
* whole. This is currently only supported on Xbox One gamepads. If you want
|
||||
* the (more common) whole-gamepad rumble, use SDL_RumbleGamepad() instead.
|
||||
*
|
||||
* This function requires you to process SDL events or call
|
||||
* SDL_UpdateJoysticks() to update rumble state.
|
||||
*
|
||||
* \param gamepad The gamepad to vibrate
|
||||
* \param left_rumble The intensity of the left trigger rumble motor, from 0
|
||||
* to 0xFFFF
|
||||
@@ -1210,50 +1305,19 @@ extern DECLSPEC int SDLCALL SDL_RumbleGamepad(SDL_Gamepad *gamepad, Uint16 low_f
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GamepadHasRumbleTriggers
|
||||
* \sa SDL_RumbleGamepad
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_RumbleGamepadTriggers(SDL_Gamepad *gamepad, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms);
|
||||
|
||||
/**
|
||||
* Query whether a gamepad has an LED.
|
||||
*
|
||||
* \param gamepad The gamepad to query
|
||||
* \returns SDL_TRUE, or SDL_FALSE if this gamepad does not have a modifiable
|
||||
* LED
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GamepadHasLED(SDL_Gamepad *gamepad);
|
||||
|
||||
/**
|
||||
* Query whether a gamepad has rumble support.
|
||||
*
|
||||
* \param gamepad The gamepad to query
|
||||
* \returns SDL_TRUE, or SDL_FALSE if this gamepad does not have rumble
|
||||
* support
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_RumbleGamepad
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GamepadHasRumble(SDL_Gamepad *gamepad);
|
||||
|
||||
/**
|
||||
* Query whether a gamepad has rumble support on triggers.
|
||||
*
|
||||
* \param gamepad The gamepad to query
|
||||
* \returns SDL_TRUE, or SDL_FALSE if this gamepad does not have trigger
|
||||
* rumble support
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_RumbleGamepadTriggers
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GamepadHasRumbleTriggers(SDL_Gamepad *gamepad);
|
||||
|
||||
/**
|
||||
* Update a gamepad's LED color.
|
||||
*
|
||||
* An example of a joystick LED is the light on the back of a PlayStation 4's
|
||||
* DualShock 4 controller.
|
||||
*
|
||||
* For gamepads with a single color LED, the maximum of the RGB values will be
|
||||
* used as the LED brightness.
|
||||
*
|
||||
* \param gamepad The gamepad to update
|
||||
* \param red The intensity of the red LED
|
||||
* \param green The intensity of the green LED
|
||||
|
||||
Reference in New Issue
Block a user