mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-12-19 19:10:31 +08:00
SDL API renaming: SDL_joystick.h
Fixes https://github.com/libsdl-org/SDL/issues/6881
This commit is contained in:
@@ -107,7 +107,7 @@ typedef struct SDL_GameControllerButtonBind
|
||||
* To count the number of game controllers in the system for the following:
|
||||
*
|
||||
* ```c
|
||||
* int nJoysticks = SDL_NumJoysticks();
|
||||
* int nJoysticks = SDL_GetNumJoysticks();
|
||||
* int nGameControllers = 0;
|
||||
* for (int i = 0; i < nJoysticks; i++) {
|
||||
* if (SDL_IsGameController(i)) {
|
||||
@@ -119,7 +119,7 @@ typedef struct SDL_GameControllerButtonBind
|
||||
* Using the SDL_HINT_GAMECONTROLLERCONFIG hint or the SDL_GameControllerAddMapping() you can add support for controllers SDL is unaware of or cause an existing controller to have a different binding. The format is:
|
||||
* guid,name,mappings
|
||||
*
|
||||
* Where GUID is the string value from SDL_JoystickGetGUIDString(), name is the human readable string for the device and mappings are controller mappings to joystick ones.
|
||||
* Where GUID is the string value from SDL_GetJoystickGUIDString(), name is the human readable string for the device and mappings are controller mappings to joystick ones.
|
||||
* Under Windows there is a reserved GUID of "xinput" that covers any XInput devices.
|
||||
* The mapping format for joystick is:
|
||||
* bX - a joystick button, index X
|
||||
@@ -176,7 +176,7 @@ extern DECLSPEC int SDLCALL SDL_GameControllerAddMappingsFromRW(SDL_RWops * rw,
|
||||
* controller to have a different binding.
|
||||
*
|
||||
* The mapping string has the format "GUID,name,mapping", where GUID is the
|
||||
* string value from SDL_JoystickGetGUIDString(), name is the human readable
|
||||
* string value from SDL_GetJoystickGUIDString(), name is the human readable
|
||||
* string for the device and mappings are controller mappings to joystick
|
||||
* ones. Under Windows there is a reserved GUID of "xinput" that covers all
|
||||
* XInput devices. The mapping format for joystick is: {| |bX |a joystick
|
||||
@@ -230,8 +230,8 @@ extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForIndex(int mapping_ind
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_JoystickGetDeviceGUID
|
||||
* \sa SDL_JoystickGetGUID
|
||||
* \sa SDL_GetJoystickDeviceGUID
|
||||
* \sa SDL_GetJoystickGUID
|
||||
*/
|
||||
extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForGUID(SDL_JoystickGUID guid);
|
||||
|
||||
@@ -258,10 +258,10 @@ extern DECLSPEC char * SDLCALL SDL_GameControllerMapping(SDL_GameController *gam
|
||||
* Check if the given joystick is supported by the game controller interface.
|
||||
*
|
||||
* `joystick_index` is the same as the `device_index` passed to
|
||||
* SDL_JoystickOpen().
|
||||
* SDL_OpenJoystick().
|
||||
*
|
||||
* \param joystick_index the device_index of a device, up to
|
||||
* SDL_NumJoysticks()
|
||||
* SDL_GetNumJoysticks()
|
||||
* \returns SDL_TRUE if the given joystick is supported by the game controller
|
||||
* interface, SDL_FALSE if it isn't or it's an invalid index.
|
||||
*
|
||||
@@ -278,10 +278,10 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsGameController(int joystick_index);
|
||||
* This function can be called before any controllers are opened.
|
||||
*
|
||||
* `joystick_index` is the same as the `device_index` passed to
|
||||
* SDL_JoystickOpen().
|
||||
* SDL_OpenJoystick().
|
||||
*
|
||||
* \param joystick_index the device_index of a device, from zero to
|
||||
* SDL_NumJoysticks()-1
|
||||
* SDL_GetNumJoysticks()-1
|
||||
* \returns the implementation-dependent name for the game controller, or NULL
|
||||
* if there is no name or the index is invalid.
|
||||
*
|
||||
@@ -299,10 +299,10 @@ extern DECLSPEC const char *SDLCALL SDL_GameControllerNameForIndex(int joystick_
|
||||
* This function can be called before any controllers are opened.
|
||||
*
|
||||
* `joystick_index` is the same as the `device_index` passed to
|
||||
* SDL_JoystickOpen().
|
||||
* SDL_OpenJoystick().
|
||||
*
|
||||
* \param joystick_index the device_index of a device, from zero to
|
||||
* SDL_NumJoysticks()-1
|
||||
* SDL_GetNumJoysticks()-1
|
||||
* \returns the implementation-dependent path for the game controller, or NULL
|
||||
* if there is no path or the index is invalid.
|
||||
*
|
||||
@@ -318,7 +318,7 @@ extern DECLSPEC const char *SDLCALL SDL_GameControllerPathForIndex(int joystick_
|
||||
* This can be called before any controllers are opened.
|
||||
*
|
||||
* \param joystick_index the device_index of a device, from zero to
|
||||
* SDL_NumJoysticks()-1
|
||||
* SDL_GetNumJoysticks()-1
|
||||
* \returns the controller type.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@@ -331,7 +331,7 @@ extern DECLSPEC SDL_GameControllerType SDLCALL SDL_GameControllerTypeForIndex(in
|
||||
* This can be called before any controllers are opened.
|
||||
*
|
||||
* \param joystick_index the device_index of a device, from zero to
|
||||
* SDL_NumJoysticks()-1
|
||||
* SDL_GetNumJoysticks()-1
|
||||
* \returns the mapping string. Must be freed with SDL_free(). Returns NULL if
|
||||
* no mapping is available.
|
||||
*
|
||||
@@ -343,7 +343,7 @@ extern DECLSPEC char *SDLCALL SDL_GameControllerMappingForDeviceIndex(int joysti
|
||||
* Open a game controller for use.
|
||||
*
|
||||
* `joystick_index` is the same as the `device_index` passed to
|
||||
* SDL_JoystickOpen().
|
||||
* SDL_OpenJoystick().
|
||||
*
|
||||
* The index passed as an argument refers to the N'th game controller on the
|
||||
* system. This index is not the value which will identify this controller in
|
||||
@@ -351,7 +351,7 @@ extern DECLSPEC char *SDLCALL SDL_GameControllerMappingForDeviceIndex(int joysti
|
||||
* be used there instead.
|
||||
*
|
||||
* \param joystick_index the device_index of a device, up to
|
||||
* SDL_NumJoysticks()
|
||||
* SDL_GetNumJoysticks()
|
||||
* \returns a gamecontroller identifier or NULL if an error occurred; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@@ -548,7 +548,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerGetAttached(SDL_GameControlle
|
||||
* value).
|
||||
*
|
||||
* The pointer returned is owned by the SDL_GameController. You should not
|
||||
* call SDL_JoystickClose() on it, for example, since doing so will likely
|
||||
* call SDL_CloseJoystick() on it, for example, since doing so will likely
|
||||
* cause SDL to crash.
|
||||
*
|
||||
* \param gamecontroller the game controller object that you want to get a
|
||||
@@ -575,7 +575,7 @@ extern DECLSPEC SDL_Joystick *SDLCALL SDL_GameControllerGetJoystick(SDL_GameCont
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_JoystickEventState
|
||||
* \sa SDL_GetJoystickEventState
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GameControllerEventState(int state);
|
||||
|
||||
|
||||
@@ -296,8 +296,8 @@ extern "C" {
|
||||
*
|
||||
* This variable can be set to the following values:
|
||||
*
|
||||
* "0" - You'll call SDL_JoystickUpdate() manually
|
||||
* "1" - SDL will automatically call SDL_JoystickUpdate() (default)
|
||||
* "0" - You'll call SDL_UpdateJoysticks() manually
|
||||
* "1" - SDL will automatically call SDL_UpdateJoysticks() (default)
|
||||
*
|
||||
* This hint can be toggled on and off at runtime.
|
||||
*/
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -49,6 +49,58 @@
|
||||
#define SDL_FreeWAV SDL_free
|
||||
#define SDL_NewAudioStream SDL_CreateAudioStream
|
||||
|
||||
/* ##SDL_joystick.h */
|
||||
#define SDL_JoystickAttachVirtual SDL_AttachVirtualJoystick
|
||||
#define SDL_JoystickAttachVirtualEx SDL_AttachVirtualJoystickEx
|
||||
#define SDL_JoystickClose SDL_CloseJoystick
|
||||
#define SDL_JoystickCurrentPowerLevel SDL_GetJoystickPowerLevel
|
||||
#define SDL_JoystickDetachVirtual SDL_DetachVirtualJoystick
|
||||
#define SDL_JoystickEventState SDL_GetJoystickEventState
|
||||
#define SDL_JoystickFromInstanceID SDL_GetJoystickFromInstanceID
|
||||
#define SDL_JoystickFromPlayerIndex SDL_GetJoystickFromPlayerIndex
|
||||
#define SDL_JoystickGetAttached SDL_IsJoystickConnected
|
||||
#define SDL_JoystickGetAxis SDL_GetJoystickAxis
|
||||
#define SDL_JoystickGetAxisInitialState SDL_GetJoystickAxisInitialState
|
||||
#define SDL_JoystickGetButton SDL_GetJoystickButton
|
||||
#define SDL_JoystickGetDeviceGUID SDL_GetJoystickDeviceGUID
|
||||
#define SDL_JoystickGetDeviceInstanceID SDL_GetJoystickDeviceInstanceID
|
||||
#define SDL_JoystickGetDevicePlayerIndex SDL_GetJoystickDevicePlayerIndex
|
||||
#define SDL_JoystickGetDeviceProduct SDL_GetJoystickDeviceProduct
|
||||
#define SDL_JoystickGetDeviceProductVersion SDL_GetJoystickDeviceProductVersion
|
||||
#define SDL_JoystickGetDeviceType SDL_GetJoystickDeviceType
|
||||
#define SDL_JoystickGetDeviceVendor SDL_GetJoystickDeviceVendor
|
||||
#define SDL_JoystickGetFirmwareVersion SDL_GetJoystickFirmwareVersion
|
||||
#define SDL_JoystickGetGUID SDL_GetJoystickGUID
|
||||
#define SDL_JoystickGetGUIDFromString SDL_GetJoystickGUIDFromString
|
||||
#define SDL_JoystickGetGUIDString SDL_GetJoystickGUIDString
|
||||
#define SDL_JoystickGetHat SDL_GetJoystickHat
|
||||
#define SDL_JoystickGetPlayerIndex SDL_GetJoystickPlayerIndex
|
||||
#define SDL_JoystickGetProduct SDL_GetJoystickProduct
|
||||
#define SDL_JoystickGetProductVersion SDL_GetJoystickProductVersion
|
||||
#define SDL_JoystickGetSerial SDL_GetJoystickSerial
|
||||
#define SDL_JoystickGetType SDL_GetJoystickType
|
||||
#define SDL_JoystickGetVendor SDL_GetJoystickVendor
|
||||
#define SDL_JoystickInstanceID SDL_GetJoystickInstanceID
|
||||
#define SDL_JoystickIsVirtual SDL_IsJoystickVirtual
|
||||
#define SDL_JoystickName SDL_GetJoystickName
|
||||
#define SDL_JoystickNameForIndex SDL_GetJoystickNameForIndex
|
||||
#define SDL_JoystickNumAxes SDL_GetNumJoystickAxes
|
||||
#define SDL_JoystickNumButtons SDL_GetNumJoystickButtons
|
||||
#define SDL_JoystickNumHats SDL_GetNumJoystickHats
|
||||
#define SDL_JoystickOpen SDL_OpenJoystick
|
||||
#define SDL_JoystickPath SDL_GetJoystickPath
|
||||
#define SDL_JoystickPathForIndex SDL_GetJoystickPathForIndex
|
||||
#define SDL_JoystickRumble SDL_RumbleJoystick
|
||||
#define SDL_JoystickRumbleTriggers SDL_RumbleJoystickTriggers
|
||||
#define SDL_JoystickSendEffect SDL_SendJoystickEffect
|
||||
#define SDL_JoystickSetLED SDL_SetJoystickLED
|
||||
#define SDL_JoystickSetPlayerIndex SDL_SetJoystickPlayerIndex
|
||||
#define SDL_JoystickSetVirtualAxis SDL_SetJoystickVirtualAxis
|
||||
#define SDL_JoystickSetVirtualButton SDL_SetJoystickVirtualButton
|
||||
#define SDL_JoystickSetVirtualHat SDL_SetJoystickVirtualHat
|
||||
#define SDL_JoystickUpdate SDL_UpdateJoysticks
|
||||
#define SDL_NumJoysticks SDL_GetNumJoysticks
|
||||
|
||||
/* ##SDL_keycode.h */
|
||||
#define KMOD_ALT SDL_KMOD_ALT
|
||||
#define KMOD_CAPS SDL_KMOD_CAPS
|
||||
@@ -94,6 +146,58 @@
|
||||
#define SDL_FreeWAV SDL_FreeWAV_renamed_SDL_free
|
||||
#define SDL_NewAudioStream SDL_NewAudioStream_renamed_SDL_CreateAudioStream
|
||||
|
||||
/* ##SDL_joystick.h */
|
||||
#define SDL_JoystickAttachVirtual SDL_JoystickAttachVirtual_renamed_SDL_AttachVirtualJoystick
|
||||
#define SDL_JoystickAttachVirtualEx SDL_JoystickAttachVirtualEx_renamed_SDL_AttachVirtualJoystickEx
|
||||
#define SDL_JoystickClose SDL_JoystickClose_renamed_SDL_CloseJoystick
|
||||
#define SDL_JoystickCurrentPowerLevel SDL_JoystickCurrentPowerLevel_renamed_SDL_GetJoystickPowerLevel
|
||||
#define SDL_JoystickDetachVirtual SDL_JoystickDetachVirtual_renamed_SDL_DetachVirtualJoystick
|
||||
#define SDL_JoystickEventState SDL_JoystickEventState_renamed_SDL_GetJoystickEventState
|
||||
#define SDL_JoystickFromInstanceID SDL_JoystickFromInstanceID_renamed_SDL_GetJoystickFromInstanceID
|
||||
#define SDL_JoystickFromPlayerIndex SDL_JoystickFromPlayerIndex_renamed_SDL_GetJoystickFromPlayerIndex
|
||||
#define SDL_JoystickGetAttached SDL_JoystickGetAttached_renamed_SDL_IsJoystickConnected
|
||||
#define SDL_JoystickGetAxis SDL_JoystickGetAxis_renamed_SDL_GetJoystickAxis
|
||||
#define SDL_JoystickGetAxisInitialState SDL_JoystickGetAxisInitialState_renamed_SDL_GetJoystickAxisInitialState
|
||||
#define SDL_JoystickGetButton SDL_JoystickGetButton_renamed_SDL_GetJoystickButton
|
||||
#define SDL_JoystickGetDeviceGUID SDL_JoystickGetDeviceGUID_renamed_SDL_GetJoystickDeviceGUID
|
||||
#define SDL_JoystickGetDeviceInstanceID SDL_JoystickGetDeviceInstanceID_renamed_SDL_GetJoystickDeviceInstanceID
|
||||
#define SDL_JoystickGetDevicePlayerIndex SDL_JoystickGetDevicePlayerIndex_renamed_SDL_GetJoystickDevicePlayerIndex
|
||||
#define SDL_JoystickGetDeviceProduct SDL_JoystickGetDeviceProduct_renamed_SDL_GetJoystickDeviceProduct
|
||||
#define SDL_JoystickGetDeviceProductVersion SDL_JoystickGetDeviceProductVersion_renamed_SDL_GetJoystickDeviceProductVersion
|
||||
#define SDL_JoystickGetDeviceType SDL_JoystickGetDeviceType_renamed_SDL_GetJoystickDeviceType
|
||||
#define SDL_JoystickGetDeviceVendor SDL_JoystickGetDeviceVendor_renamed_SDL_GetJoystickDeviceVendor
|
||||
#define SDL_JoystickGetFirmwareVersion SDL_JoystickGetFirmwareVersion_renamed_SDL_GetJoystickFirmwareVersion
|
||||
#define SDL_JoystickGetGUID SDL_JoystickGetGUID_renamed_SDL_GetJoystickGUID
|
||||
#define SDL_JoystickGetGUIDFromString SDL_JoystickGetGUIDFromString_renamed_SDL_GetJoystickGUIDFromString
|
||||
#define SDL_JoystickGetGUIDString SDL_JoystickGetGUIDString_renamed_SDL_GetJoystickGUIDString
|
||||
#define SDL_JoystickGetHat SDL_JoystickGetHat_renamed_SDL_GetJoystickHat
|
||||
#define SDL_JoystickGetPlayerIndex SDL_JoystickGetPlayerIndex_renamed_SDL_GetJoystickPlayerIndex
|
||||
#define SDL_JoystickGetProduct SDL_JoystickGetProduct_renamed_SDL_GetJoystickProduct
|
||||
#define SDL_JoystickGetProductVersion SDL_JoystickGetProductVersion_renamed_SDL_GetJoystickProductVersion
|
||||
#define SDL_JoystickGetSerial SDL_JoystickGetSerial_renamed_SDL_GetJoystickSerial
|
||||
#define SDL_JoystickGetType SDL_JoystickGetType_renamed_SDL_GetJoystickType
|
||||
#define SDL_JoystickGetVendor SDL_JoystickGetVendor_renamed_SDL_GetJoystickVendor
|
||||
#define SDL_JoystickInstanceID SDL_JoystickInstanceID_renamed_SDL_GetJoystickInstanceID
|
||||
#define SDL_JoystickIsVirtual SDL_JoystickIsVirtual_renamed_SDL_IsJoystickVirtual
|
||||
#define SDL_JoystickName SDL_JoystickName_renamed_SDL_GetJoystickName
|
||||
#define SDL_JoystickNameForIndex SDL_JoystickNameForIndex_renamed_SDL_GetJoystickNameForIndex
|
||||
#define SDL_JoystickNumAxes SDL_JoystickNumAxes_renamed_SDL_GetNumJoystickAxes
|
||||
#define SDL_JoystickNumButtons SDL_JoystickNumButtons_renamed_SDL_GetNumJoystickButtons
|
||||
#define SDL_JoystickNumHats SDL_JoystickNumHats_renamed_SDL_GetNumJoystickHats
|
||||
#define SDL_JoystickOpen SDL_JoystickOpen_renamed_SDL_OpenJoystick
|
||||
#define SDL_JoystickPath SDL_JoystickPath_renamed_SDL_GetJoystickPath
|
||||
#define SDL_JoystickPathForIndex SDL_JoystickPathForIndex_renamed_SDL_GetJoystickPathForIndex
|
||||
#define SDL_JoystickRumble SDL_JoystickRumble_renamed_SDL_RumbleJoystick
|
||||
#define SDL_JoystickRumbleTriggers SDL_JoystickRumbleTriggers_renamed_SDL_RumbleJoystickTriggers
|
||||
#define SDL_JoystickSendEffect SDL_JoystickSendEffect_renamed_SDL_SendJoystickEffect
|
||||
#define SDL_JoystickSetLED SDL_JoystickSetLED_renamed_SDL_SetJoystickLED
|
||||
#define SDL_JoystickSetPlayerIndex SDL_JoystickSetPlayerIndex_renamed_SDL_SetJoystickPlayerIndex
|
||||
#define SDL_JoystickSetVirtualAxis SDL_JoystickSetVirtualAxis_renamed_SDL_SetJoystickVirtualAxis
|
||||
#define SDL_JoystickSetVirtualButton SDL_JoystickSetVirtualButton_renamed_SDL_SetJoystickVirtualButton
|
||||
#define SDL_JoystickSetVirtualHat SDL_JoystickSetVirtualHat_renamed_SDL_SetJoystickVirtualHat
|
||||
#define SDL_JoystickUpdate SDL_JoystickUpdate_renamed_SDL_UpdateJoysticks
|
||||
#define SDL_NumJoysticks SDL_NumJoysticks_renamed_SDL_GetNumJoysticks
|
||||
|
||||
/* ##SDL_keycode.h */
|
||||
#define KMOD_ALT KMOD_ALT_renamed_SDL_KMOD_ALT
|
||||
#define KMOD_CAPS KMOD_CAPS_renamed_SDL_KMOD_CAPS
|
||||
|
||||
Reference in New Issue
Block a user