mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-21 04:53:03 +08:00
SDL API renaming: SDL_joystick.h
Fixes https://github.com/libsdl-org/SDL/issues/6881
This commit is contained in:
@@ -23,7 +23,57 @@ General:
|
||||
* SDL_AudioStreamGet => SDL_GetAudioStreamData
|
||||
* SDL_AudioStreamPut => SDL_PutAudioStreamData
|
||||
* SDL_FreeAudioStream => SDL_DestroyAudioStream
|
||||
* SDL_JoystickAttachVirtual => SDL_AttachVirtualJoystick
|
||||
* SDL_JoystickAttachVirtualEx => SDL_AttachVirtualJoystickEx
|
||||
* SDL_JoystickClose => SDL_CloseJoystick
|
||||
* SDL_JoystickCurrentPowerLevel => SDL_GetJoystickPowerLevel
|
||||
* SDL_JoystickDetachVirtual => SDL_DetachVirtualJoystick
|
||||
* SDL_JoystickEventState => SDL_GetJoystickEventState
|
||||
* SDL_JoystickFromInstanceID => SDL_GetJoystickFromInstanceID
|
||||
* SDL_JoystickFromPlayerIndex => SDL_GetJoystickFromPlayerIndex
|
||||
* SDL_JoystickGetAttached => SDL_IsJoystickConnected
|
||||
* SDL_JoystickGetAxis => SDL_GetJoystickAxis
|
||||
* SDL_JoystickGetAxisInitialState => SDL_GetJoystickAxisInitialState
|
||||
* SDL_JoystickGetButton => SDL_GetJoystickButton
|
||||
* SDL_JoystickGetDeviceGUID => SDL_GetJoystickDeviceGUID
|
||||
* SDL_JoystickGetDeviceInstanceID => SDL_GetJoystickDeviceInstanceID
|
||||
* SDL_JoystickGetDevicePlayerIndex => SDL_GetJoystickDevicePlayerIndex
|
||||
* SDL_JoystickGetDeviceProduct => SDL_GetJoystickDeviceProduct
|
||||
* SDL_JoystickGetDeviceProductVersion => SDL_GetJoystickDeviceProductVersion
|
||||
* SDL_JoystickGetDeviceType => SDL_GetJoystickDeviceType
|
||||
* SDL_JoystickGetDeviceVendor => SDL_GetJoystickDeviceVendor
|
||||
* SDL_JoystickGetFirmwareVersion => SDL_GetJoystickFirmwareVersion
|
||||
* SDL_JoystickGetGUID => SDL_GetJoystickGUID
|
||||
* SDL_JoystickGetGUIDFromString => SDL_GetJoystickGUIDFromString
|
||||
* SDL_JoystickGetGUIDString => SDL_GetJoystickGUIDString
|
||||
* SDL_JoystickGetHat => SDL_GetJoystickHat
|
||||
* SDL_JoystickGetPlayerIndex => SDL_GetJoystickPlayerIndex
|
||||
* SDL_JoystickGetProduct => SDL_GetJoystickProduct
|
||||
* SDL_JoystickGetProductVersion => SDL_GetJoystickProductVersion
|
||||
* SDL_JoystickGetSerial => SDL_GetJoystickSerial
|
||||
* SDL_JoystickGetType => SDL_GetJoystickType
|
||||
* SDL_JoystickGetVendor => SDL_GetJoystickVendor
|
||||
* SDL_JoystickInstanceID => SDL_GetJoystickInstanceID
|
||||
* SDL_JoystickIsVirtual => SDL_IsJoystickVirtual
|
||||
* SDL_JoystickName => SDL_GetJoystickName
|
||||
* SDL_JoystickNameForIndex => SDL_GetJoystickNameForIndex
|
||||
* SDL_JoystickNumAxes => SDL_GetNumJoystickAxes
|
||||
* SDL_JoystickNumButtons => SDL_GetNumJoystickButtons
|
||||
* SDL_JoystickNumHats => SDL_GetNumJoystickHats
|
||||
* SDL_JoystickOpen => SDL_OpenJoystick
|
||||
* SDL_JoystickPath => SDL_GetJoystickPath
|
||||
* SDL_JoystickPathForIndex => SDL_GetJoystickPathForIndex
|
||||
* SDL_JoystickRumble => SDL_RumbleJoystick
|
||||
* SDL_JoystickRumbleTriggers => SDL_RumbleJoystickTriggers
|
||||
* SDL_JoystickSendEffect => SDL_SendJoystickEffect
|
||||
* SDL_JoystickSetLED => SDL_SetJoystickLED
|
||||
* SDL_JoystickSetPlayerIndex => SDL_SetJoystickPlayerIndex
|
||||
* SDL_JoystickSetVirtualAxis => SDL_SetJoystickVirtualAxis
|
||||
* SDL_JoystickSetVirtualButton => SDL_SetJoystickVirtualButton
|
||||
* SDL_JoystickSetVirtualHat => SDL_SetJoystickVirtualHat
|
||||
* SDL_JoystickUpdate => SDL_UpdateJoysticks
|
||||
* SDL_NewAudioStream => SDL_CreateAudioStream
|
||||
* SDL_NumJoysticks => SDL_GetNumJoysticks
|
||||
* Removed the following functions from the API, see docs/README-migration.md for details:
|
||||
* SDL_AudioInit()
|
||||
* SDL_AudioQuit()
|
||||
|
||||
@@ -18,7 +18,7 @@ Happy (happy.c):
|
||||
|
||||
Accelerometer (accelerometer.c):
|
||||
|
||||
Uses the iPhone's accelerometer as a joystick device to move a spaceship around the screen. Note the use of the macro SDL_IPHONE_MAX_GFORCE (normally defined in SDL_config_ios.h) which converts between the Sint16 number returned by SDL_JoystickGetAxis, and the floating point units of g-force reported natively by the iPhone.
|
||||
Uses the iPhone's accelerometer as a joystick device to move a spaceship around the screen. Note the use of the macro SDL_IPHONE_MAX_GFORCE (normally defined in SDL_config_ios.h) which converts between the Sint16 number returned by SDL_GetJoystickAxis, and the floating point units of g-force reported natively by the iPhone.
|
||||
|
||||
Touch (touch.c):
|
||||
|
||||
|
||||
@@ -37,8 +37,8 @@ render(SDL_Renderer *renderer, int w, int h, double deltaTime)
|
||||
float speed;
|
||||
|
||||
/* get joystick (accelerometer) axis values and normalize them */
|
||||
float ax = SDL_JoystickGetAxis(accelerometer, 0);
|
||||
float ay = SDL_JoystickGetAxis(accelerometer, 1);
|
||||
float ax = SDL_GetJoystickAxis(accelerometer, 0);
|
||||
float ay = SDL_GetJoystickAxis(accelerometer, 1);
|
||||
|
||||
/* ship screen constraints */
|
||||
Uint32 minx = 0.0f;
|
||||
@@ -177,18 +177,18 @@ main(int argc, char *argv[])
|
||||
SDL_RenderSetLogicalSize(renderer, w, h);
|
||||
|
||||
/* print out some info about joysticks and try to open accelerometer for use */
|
||||
printf("There are %d joysticks available\n", SDL_NumJoysticks());
|
||||
printf("Default joystick (index 0) is %s\n", SDL_JoystickName(0));
|
||||
accelerometer = SDL_JoystickOpen(0);
|
||||
printf("There are %d joysticks available\n", SDL_GetNumJoysticks());
|
||||
printf("Default joystick (index 0) is %s\n", SDL_GetJoystickName(0));
|
||||
accelerometer = SDL_OpenJoystick(0);
|
||||
if (accelerometer == NULL) {
|
||||
fatalError("Could not open joystick (accelerometer)");
|
||||
}
|
||||
printf("joystick number of axis = %d\n",
|
||||
SDL_JoystickNumAxes(accelerometer));
|
||||
SDL_GetNumJoystickAxes(accelerometer));
|
||||
printf("joystick number of hats = %d\n",
|
||||
SDL_JoystickNumHats(accelerometer));
|
||||
SDL_GetNumJoystickHats(accelerometer));
|
||||
printf("joystick number of buttons = %d\n",
|
||||
SDL_JoystickNumButtons(accelerometer));
|
||||
SDL_GetNumJoystickButtons(accelerometer));
|
||||
|
||||
/* load graphics */
|
||||
initializeTextures(renderer);
|
||||
|
||||
+1
-1
@@ -126,7 +126,7 @@ Notes -- Accelerometer as Joystick
|
||||
|
||||
SDL for iPhone supports polling the built in accelerometer as a joystick device. For an example on how to do this, see the accelerometer.c in the demos directory.
|
||||
|
||||
The main thing to note when using the accelerometer with SDL is that while the iPhone natively reports accelerometer as floating point values in units of g-force, SDL_JoystickGetAxis() reports joystick values as signed integers. Hence, in order to convert between the two, some clamping and scaling is necessary on the part of the iPhone SDL joystick driver. To convert SDL_JoystickGetAxis() reported values BACK to units of g-force, simply multiply the values by SDL_IPHONE_MAX_GFORCE / 0x7FFF.
|
||||
The main thing to note when using the accelerometer with SDL is that while the iPhone natively reports accelerometer as floating point values in units of g-force, SDL_GetJoystickAxis() reports joystick values as signed integers. Hence, in order to convert between the two, some clamping and scaling is necessary on the part of the iPhone SDL joystick driver. To convert SDL_GetJoystickAxis() reported values BACK to units of g-force, simply multiply the values by SDL_IPHONE_MAX_GFORCE / 0x7FFF.
|
||||
|
||||
|
||||
Notes -- OpenGL ES
|
||||
|
||||
@@ -112,6 +112,60 @@ The following hints have been removed:
|
||||
* Renamed hints 'SDL_HINT_VIDEODRIVER' and 'SDL_HINT_AUDIODRIVER' to 'SDL_HINT_VIDEO_DRIVER' and 'SDL_HINT_AUDIO_DRIVER'
|
||||
* Renamed environment variables 'SDL_VIDEODRIVER' and 'SDL_AUDIODRIVER' to 'SDL_VIDEO_DRIVER' and 'SDL_AUDIO_DRIVER'
|
||||
|
||||
## SDL_joystick.h
|
||||
|
||||
The following functions have been renamed:
|
||||
* SDL_JoystickAttachVirtual => SDL_AttachVirtualJoystick
|
||||
* SDL_JoystickAttachVirtualEx => SDL_AttachVirtualJoystickEx
|
||||
* SDL_JoystickClose => SDL_CloseJoystick
|
||||
* SDL_JoystickCurrentPowerLevel => SDL_GetJoystickPowerLevel
|
||||
* SDL_JoystickDetachVirtual => SDL_DetachVirtualJoystick
|
||||
* SDL_JoystickEventState => SDL_GetJoystickEventState
|
||||
* SDL_JoystickFromInstanceID => SDL_GetJoystickFromInstanceID
|
||||
* SDL_JoystickFromPlayerIndex => SDL_GetJoystickFromPlayerIndex
|
||||
* SDL_JoystickGetAttached => SDL_IsJoystickConnected
|
||||
* SDL_JoystickGetAxis => SDL_GetJoystickAxis
|
||||
* SDL_JoystickGetAxisInitialState => SDL_GetJoystickAxisInitialState
|
||||
* SDL_JoystickGetButton => SDL_GetJoystickButton
|
||||
* SDL_JoystickGetDeviceGUID => SDL_GetJoystickDeviceGUID
|
||||
* SDL_JoystickGetDeviceInstanceID => SDL_GetJoystickDeviceInstanceID
|
||||
* SDL_JoystickGetDevicePlayerIndex => SDL_GetJoystickDevicePlayerIndex
|
||||
* SDL_JoystickGetDeviceProduct => SDL_GetJoystickDeviceProduct
|
||||
* SDL_JoystickGetDeviceProductVersion => SDL_GetJoystickDeviceProductVersion
|
||||
* SDL_JoystickGetDeviceType => SDL_GetJoystickDeviceType
|
||||
* SDL_JoystickGetDeviceVendor => SDL_GetJoystickDeviceVendor
|
||||
* SDL_JoystickGetFirmwareVersion => SDL_GetJoystickFirmwareVersion
|
||||
* SDL_JoystickGetGUID => SDL_GetJoystickGUID
|
||||
* SDL_JoystickGetGUIDFromString => SDL_GetJoystickGUIDFromString
|
||||
* SDL_JoystickGetGUIDString => SDL_GetJoystickGUIDString
|
||||
* SDL_JoystickGetHat => SDL_GetJoystickHat
|
||||
* SDL_JoystickGetPlayerIndex => SDL_GetJoystickPlayerIndex
|
||||
* SDL_JoystickGetProduct => SDL_GetJoystickProduct
|
||||
* SDL_JoystickGetProductVersion => SDL_GetJoystickProductVersion
|
||||
* SDL_JoystickGetSerial => SDL_GetJoystickSerial
|
||||
* SDL_JoystickGetType => SDL_GetJoystickType
|
||||
* SDL_JoystickGetVendor => SDL_GetJoystickVendor
|
||||
* SDL_JoystickInstanceID => SDL_GetJoystickInstanceID
|
||||
* SDL_JoystickIsVirtual => SDL_IsJoystickVirtual
|
||||
* SDL_JoystickName => SDL_GetJoystickName
|
||||
* SDL_JoystickNameForIndex => SDL_GetJoystickNameForIndex
|
||||
* SDL_JoystickNumAxes => SDL_GetNumJoystickAxes
|
||||
* SDL_JoystickNumButtons => SDL_GetNumJoystickButtons
|
||||
* SDL_JoystickNumHats => SDL_GetNumJoystickHats
|
||||
* SDL_JoystickOpen => SDL_OpenJoystick
|
||||
* SDL_JoystickPath => SDL_GetJoystickPath
|
||||
* SDL_JoystickPathForIndex => SDL_GetJoystickPathForIndex
|
||||
* SDL_JoystickRumble => SDL_RumbleJoystick
|
||||
* SDL_JoystickRumbleTriggers => SDL_RumbleJoystickTriggers
|
||||
* SDL_JoystickSendEffect => SDL_SendJoystickEffect
|
||||
* SDL_JoystickSetLED => SDL_SetJoystickLED
|
||||
* SDL_JoystickSetPlayerIndex => SDL_SetJoystickPlayerIndex
|
||||
* SDL_JoystickSetVirtualAxis => SDL_SetJoystickVirtualAxis
|
||||
* SDL_JoystickSetVirtualButton => SDL_SetJoystickVirtualButton
|
||||
* SDL_JoystickSetVirtualHat => SDL_SetJoystickVirtualHat
|
||||
* SDL_JoystickUpdate => SDL_UpdateJoysticks
|
||||
* SDL_NumJoysticks => SDL_GetNumJoysticks
|
||||
|
||||
## SDL_keycode.h
|
||||
|
||||
The following enums have been renamed:
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
+114
-114
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
|
||||
|
||||
+50
-50
@@ -696,60 +696,60 @@ SDL3_0.0.0 {
|
||||
SDL_ComposeCustomBlendMode;
|
||||
SDL_LockJoysticks;
|
||||
SDL_UnlockJoysticks;
|
||||
SDL_NumJoysticks;
|
||||
SDL_JoystickNameForIndex;
|
||||
SDL_JoystickPathForIndex;
|
||||
SDL_JoystickGetDevicePlayerIndex;
|
||||
SDL_JoystickGetDeviceGUID;
|
||||
SDL_JoystickGetDeviceVendor;
|
||||
SDL_JoystickGetDeviceProduct;
|
||||
SDL_JoystickGetDeviceProductVersion;
|
||||
SDL_JoystickGetDeviceType;
|
||||
SDL_JoystickGetDeviceInstanceID;
|
||||
SDL_JoystickOpen;
|
||||
SDL_JoystickFromInstanceID;
|
||||
SDL_JoystickFromPlayerIndex;
|
||||
SDL_JoystickAttachVirtual;
|
||||
SDL_JoystickAttachVirtualEx;
|
||||
SDL_JoystickDetachVirtual;
|
||||
SDL_JoystickIsVirtual;
|
||||
SDL_JoystickSetVirtualAxis;
|
||||
SDL_JoystickSetVirtualButton;
|
||||
SDL_JoystickSetVirtualHat;
|
||||
SDL_JoystickName;
|
||||
SDL_JoystickPath;
|
||||
SDL_JoystickGetPlayerIndex;
|
||||
SDL_JoystickSetPlayerIndex;
|
||||
SDL_JoystickGetGUID;
|
||||
SDL_JoystickGetVendor;
|
||||
SDL_JoystickGetProduct;
|
||||
SDL_JoystickGetProductVersion;
|
||||
SDL_JoystickGetFirmwareVersion;
|
||||
SDL_JoystickGetSerial;
|
||||
SDL_JoystickGetType;
|
||||
SDL_JoystickGetGUIDString;
|
||||
SDL_JoystickGetGUIDFromString;
|
||||
SDL_GetNumJoysticks;
|
||||
SDL_GetJoystickNameForIndex;
|
||||
SDL_GetJoystickPathForIndex;
|
||||
SDL_GetJoystickDevicePlayerIndex;
|
||||
SDL_GetJoystickDeviceGUID;
|
||||
SDL_GetJoystickDeviceVendor;
|
||||
SDL_GetJoystickDeviceProduct;
|
||||
SDL_GetJoystickDeviceProductVersion;
|
||||
SDL_GetJoystickDeviceType;
|
||||
SDL_GetJoystickDeviceInstanceID;
|
||||
SDL_OpenJoystick;
|
||||
SDL_GetJoystickFromInstanceID;
|
||||
SDL_GetJoystickFromPlayerIndex;
|
||||
SDL_AttachVirtualJoystick;
|
||||
SDL_AttachVirtualJoystickEx;
|
||||
SDL_DetachVirtualJoystick;
|
||||
SDL_IsJoystickVirtual;
|
||||
SDL_SetJoystickVirtualAxis;
|
||||
SDL_SetJoystickVirtualButton;
|
||||
SDL_SetJoystickVirtualHat;
|
||||
SDL_GetJoystickName;
|
||||
SDL_GetJoystickPath;
|
||||
SDL_GetJoystickPlayerIndex;
|
||||
SDL_SetJoystickPlayerIndex;
|
||||
SDL_GetJoystickGUID;
|
||||
SDL_GetJoystickVendor;
|
||||
SDL_GetJoystickProduct;
|
||||
SDL_GetJoystickProductVersion;
|
||||
SDL_GetJoystickFirmwareVersion;
|
||||
SDL_GetJoystickSerial;
|
||||
SDL_GetJoystickType;
|
||||
SDL_GetJoystickGUIDString;
|
||||
SDL_GetJoystickGUIDFromString;
|
||||
SDL_GetJoystickGUIDInfo;
|
||||
SDL_JoystickGetAttached;
|
||||
SDL_JoystickInstanceID;
|
||||
SDL_JoystickNumAxes;
|
||||
SDL_JoystickNumHats;
|
||||
SDL_JoystickNumButtons;
|
||||
SDL_JoystickUpdate;
|
||||
SDL_JoystickEventState;
|
||||
SDL_JoystickGetAxis;
|
||||
SDL_JoystickGetAxisInitialState;
|
||||
SDL_JoystickGetHat;
|
||||
SDL_JoystickGetButton;
|
||||
SDL_JoystickRumble;
|
||||
SDL_JoystickRumbleTriggers;
|
||||
SDL_IsJoystickConnected;
|
||||
SDL_GetJoystickInstanceID;
|
||||
SDL_GetNumJoystickAxes;
|
||||
SDL_GetNumJoystickHats;
|
||||
SDL_GetNumJoystickButtons;
|
||||
SDL_UpdateJoysticks;
|
||||
SDL_GetJoystickEventState;
|
||||
SDL_GetJoystickAxis;
|
||||
SDL_GetJoystickAxisInitialState;
|
||||
SDL_GetJoystickHat;
|
||||
SDL_GetJoystickButton;
|
||||
SDL_RumbleJoystick;
|
||||
SDL_RumbleJoystickTriggers;
|
||||
SDL_JoystickHasLED;
|
||||
SDL_JoystickHasRumble;
|
||||
SDL_JoystickHasRumbleTriggers;
|
||||
SDL_JoystickSetLED;
|
||||
SDL_JoystickSendEffect;
|
||||
SDL_JoystickClose;
|
||||
SDL_JoystickCurrentPowerLevel;
|
||||
SDL_SetJoystickLED;
|
||||
SDL_SendJoystickEffect;
|
||||
SDL_CloseJoystick;
|
||||
SDL_GetJoystickPowerLevel;
|
||||
SDL_Metal_CreateView;
|
||||
SDL_Metal_DestroyView;
|
||||
SDL_Metal_GetLayer;
|
||||
|
||||
@@ -182,25 +182,25 @@
|
||||
#define SDL_AddHintCallback SDL_AddHintCallback_REAL
|
||||
#define SDL_DelHintCallback SDL_DelHintCallback_REAL
|
||||
#define SDL_ClearHints SDL_ClearHints_REAL
|
||||
#define SDL_NumJoysticks SDL_NumJoysticks_REAL
|
||||
#define SDL_JoystickNameForIndex SDL_JoystickNameForIndex_REAL
|
||||
#define SDL_JoystickOpen SDL_JoystickOpen_REAL
|
||||
#define SDL_JoystickName SDL_JoystickName_REAL
|
||||
#define SDL_JoystickGetDeviceGUID SDL_JoystickGetDeviceGUID_REAL
|
||||
#define SDL_JoystickGetGUID SDL_JoystickGetGUID_REAL
|
||||
#define SDL_JoystickGetGUIDString SDL_JoystickGetGUIDString_REAL
|
||||
#define SDL_JoystickGetGUIDFromString SDL_JoystickGetGUIDFromString_REAL
|
||||
#define SDL_JoystickGetAttached SDL_JoystickGetAttached_REAL
|
||||
#define SDL_JoystickInstanceID SDL_JoystickInstanceID_REAL
|
||||
#define SDL_JoystickNumAxes SDL_JoystickNumAxes_REAL
|
||||
#define SDL_JoystickNumHats SDL_JoystickNumHats_REAL
|
||||
#define SDL_JoystickNumButtons SDL_JoystickNumButtons_REAL
|
||||
#define SDL_JoystickUpdate SDL_JoystickUpdate_REAL
|
||||
#define SDL_JoystickEventState SDL_JoystickEventState_REAL
|
||||
#define SDL_JoystickGetAxis SDL_JoystickGetAxis_REAL
|
||||
#define SDL_JoystickGetHat SDL_JoystickGetHat_REAL
|
||||
#define SDL_JoystickGetButton SDL_JoystickGetButton_REAL
|
||||
#define SDL_JoystickClose SDL_JoystickClose_REAL
|
||||
#define SDL_GetNumJoysticks SDL_GetNumJoysticks_REAL
|
||||
#define SDL_GetJoystickNameForIndex SDL_GetJoystickNameForIndex_REAL
|
||||
#define SDL_OpenJoystick SDL_OpenJoystick_REAL
|
||||
#define SDL_GetJoystickName SDL_GetJoystickName_REAL
|
||||
#define SDL_GetJoystickDeviceGUID SDL_GetJoystickDeviceGUID_REAL
|
||||
#define SDL_GetJoystickGUID SDL_GetJoystickGUID_REAL
|
||||
#define SDL_GetJoystickGUIDString SDL_GetJoystickGUIDString_REAL
|
||||
#define SDL_GetJoystickGUIDFromString SDL_GetJoystickGUIDFromString_REAL
|
||||
#define SDL_IsJoystickConnected SDL_IsJoystickConnected_REAL
|
||||
#define SDL_GetJoystickInstanceID SDL_GetJoystickInstanceID_REAL
|
||||
#define SDL_GetNumJoystickAxes SDL_GetNumJoystickAxes_REAL
|
||||
#define SDL_GetNumJoystickHats SDL_GetNumJoystickHats_REAL
|
||||
#define SDL_GetNumJoystickButtons SDL_GetNumJoystickButtons_REAL
|
||||
#define SDL_UpdateJoysticks SDL_UpdateJoysticks_REAL
|
||||
#define SDL_GetJoystickEventState SDL_GetJoystickEventState_REAL
|
||||
#define SDL_GetJoystickAxis SDL_GetJoystickAxis_REAL
|
||||
#define SDL_GetJoystickHat SDL_GetJoystickHat_REAL
|
||||
#define SDL_GetJoystickButton SDL_GetJoystickButton_REAL
|
||||
#define SDL_CloseJoystick SDL_CloseJoystick_REAL
|
||||
#define SDL_GetKeyboardFocus SDL_GetKeyboardFocus_REAL
|
||||
#define SDL_GetKeyboardState SDL_GetKeyboardState_REAL
|
||||
#define SDL_GetModState SDL_GetModState_REAL
|
||||
@@ -562,9 +562,9 @@
|
||||
#define SDL_ClearQueuedAudio SDL_ClearQueuedAudio_REAL
|
||||
#define SDL_GetGrabbedWindow SDL_GetGrabbedWindow_REAL
|
||||
#define SDL_SetWindowsMessageHook SDL_SetWindowsMessageHook_REAL
|
||||
#define SDL_JoystickCurrentPowerLevel SDL_JoystickCurrentPowerLevel_REAL
|
||||
#define SDL_GetJoystickPowerLevel SDL_GetJoystickPowerLevel_REAL
|
||||
#define SDL_GameControllerFromInstanceID SDL_GameControllerFromInstanceID_REAL
|
||||
#define SDL_JoystickFromInstanceID SDL_JoystickFromInstanceID_REAL
|
||||
#define SDL_GetJoystickFromInstanceID SDL_GetJoystickFromInstanceID_REAL
|
||||
#define SDL_GetDisplayUsableBounds SDL_GetDisplayUsableBounds_REAL
|
||||
#define SDL_GetWindowBordersSize SDL_GetWindowBordersSize_REAL
|
||||
#define SDL_SetWindowOpacity SDL_SetWindowOpacity_REAL
|
||||
@@ -578,24 +578,24 @@
|
||||
#define SDL_CreateSurface SDL_CreateSurface_REAL
|
||||
#define SDL_CreateSurfaceFrom SDL_CreateSurfaceFrom_REAL
|
||||
#define SDL_GetHintBoolean SDL_GetHintBoolean_REAL
|
||||
#define SDL_JoystickGetDeviceVendor SDL_JoystickGetDeviceVendor_REAL
|
||||
#define SDL_JoystickGetDeviceProduct SDL_JoystickGetDeviceProduct_REAL
|
||||
#define SDL_JoystickGetDeviceProductVersion SDL_JoystickGetDeviceProductVersion_REAL
|
||||
#define SDL_JoystickGetVendor SDL_JoystickGetVendor_REAL
|
||||
#define SDL_JoystickGetProduct SDL_JoystickGetProduct_REAL
|
||||
#define SDL_JoystickGetProductVersion SDL_JoystickGetProductVersion_REAL
|
||||
#define SDL_GetJoystickDeviceVendor SDL_GetJoystickDeviceVendor_REAL
|
||||
#define SDL_GetJoystickDeviceProduct SDL_GetJoystickDeviceProduct_REAL
|
||||
#define SDL_GetJoystickDeviceProductVersion SDL_GetJoystickDeviceProductVersion_REAL
|
||||
#define SDL_GetJoystickVendor SDL_GetJoystickVendor_REAL
|
||||
#define SDL_GetJoystickProduct SDL_GetJoystickProduct_REAL
|
||||
#define SDL_GetJoystickProductVersion SDL_GetJoystickProductVersion_REAL
|
||||
#define SDL_GameControllerGetVendor SDL_GameControllerGetVendor_REAL
|
||||
#define SDL_GameControllerGetProduct SDL_GameControllerGetProduct_REAL
|
||||
#define SDL_GameControllerGetProductVersion SDL_GameControllerGetProductVersion_REAL
|
||||
#define SDL_HasNEON SDL_HasNEON_REAL
|
||||
#define SDL_GameControllerNumMappings SDL_GameControllerNumMappings_REAL
|
||||
#define SDL_GameControllerMappingForIndex SDL_GameControllerMappingForIndex_REAL
|
||||
#define SDL_JoystickGetAxisInitialState SDL_JoystickGetAxisInitialState_REAL
|
||||
#define SDL_JoystickGetDeviceType SDL_JoystickGetDeviceType_REAL
|
||||
#define SDL_JoystickGetType SDL_JoystickGetType_REAL
|
||||
#define SDL_GetJoystickAxisInitialState SDL_GetJoystickAxisInitialState_REAL
|
||||
#define SDL_GetJoystickDeviceType SDL_GetJoystickDeviceType_REAL
|
||||
#define SDL_GetJoystickType SDL_GetJoystickType_REAL
|
||||
#define SDL_MemoryBarrierReleaseFunction SDL_MemoryBarrierReleaseFunction_REAL
|
||||
#define SDL_MemoryBarrierAcquireFunction SDL_MemoryBarrierAcquireFunction_REAL
|
||||
#define SDL_JoystickGetDeviceInstanceID SDL_JoystickGetDeviceInstanceID_REAL
|
||||
#define SDL_GetJoystickDeviceInstanceID SDL_GetJoystickDeviceInstanceID_REAL
|
||||
#define SDL_utf8strlen SDL_utf8strlen_REAL
|
||||
#define SDL_LoadFile_RW SDL_LoadFile_RW_REAL
|
||||
#define SDL_wcscmp SDL_wcscmp_REAL
|
||||
@@ -651,7 +651,7 @@
|
||||
#define SDL_expf SDL_expf_REAL
|
||||
#define SDL_wcsdup SDL_wcsdup_REAL
|
||||
#define SDL_GameControllerRumble SDL_GameControllerRumble_REAL
|
||||
#define SDL_JoystickRumble SDL_JoystickRumble_REAL
|
||||
#define SDL_RumbleJoystick SDL_RumbleJoystick_REAL
|
||||
#define SDL_NumSensors SDL_NumSensors_REAL
|
||||
#define SDL_SensorGetDeviceName SDL_SensorGetDeviceName_REAL
|
||||
#define SDL_SensorGetDeviceType SDL_SensorGetDeviceType_REAL
|
||||
@@ -670,8 +670,8 @@
|
||||
#define SDL_GetDisplayOrientation SDL_GetDisplayOrientation_REAL
|
||||
#define SDL_HasColorKey SDL_HasColorKey_REAL
|
||||
#define SDL_CreateThreadWithStackSize SDL_CreateThreadWithStackSize_REAL
|
||||
#define SDL_JoystickGetDevicePlayerIndex SDL_JoystickGetDevicePlayerIndex_REAL
|
||||
#define SDL_JoystickGetPlayerIndex SDL_JoystickGetPlayerIndex_REAL
|
||||
#define SDL_GetJoystickDevicePlayerIndex SDL_GetJoystickDevicePlayerIndex_REAL
|
||||
#define SDL_GetJoystickPlayerIndex SDL_GetJoystickPlayerIndex_REAL
|
||||
#define SDL_GameControllerGetPlayerIndex SDL_GameControllerGetPlayerIndex_REAL
|
||||
#define SDL_RenderFlush SDL_RenderFlush_REAL
|
||||
#define SDL_RenderDrawPointF SDL_RenderDrawPointF_REAL
|
||||
@@ -706,8 +706,8 @@
|
||||
#define SDL_GameControllerGetType SDL_GameControllerGetType_REAL
|
||||
#define SDL_GameControllerFromPlayerIndex SDL_GameControllerFromPlayerIndex_REAL
|
||||
#define SDL_GameControllerSetPlayerIndex SDL_GameControllerSetPlayerIndex_REAL
|
||||
#define SDL_JoystickFromPlayerIndex SDL_JoystickFromPlayerIndex_REAL
|
||||
#define SDL_JoystickSetPlayerIndex SDL_JoystickSetPlayerIndex_REAL
|
||||
#define SDL_GetJoystickFromPlayerIndex SDL_GetJoystickFromPlayerIndex_REAL
|
||||
#define SDL_SetJoystickPlayerIndex SDL_SetJoystickPlayerIndex_REAL
|
||||
#define SDL_SetTextureScaleMode SDL_SetTextureScaleMode_REAL
|
||||
#define SDL_GetTextureScaleMode SDL_GetTextureScaleMode_REAL
|
||||
#define SDL_OnApplicationWillTerminate SDL_OnApplicationWillTerminate_REAL
|
||||
@@ -720,12 +720,12 @@
|
||||
#define SDL_GetAndroidSDKVersion SDL_GetAndroidSDKVersion_REAL
|
||||
#define SDL_isupper SDL_isupper_REAL
|
||||
#define SDL_islower SDL_islower_REAL
|
||||
#define SDL_JoystickAttachVirtual SDL_JoystickAttachVirtual_REAL
|
||||
#define SDL_JoystickDetachVirtual SDL_JoystickDetachVirtual_REAL
|
||||
#define SDL_JoystickIsVirtual SDL_JoystickIsVirtual_REAL
|
||||
#define SDL_JoystickSetVirtualAxis SDL_JoystickSetVirtualAxis_REAL
|
||||
#define SDL_JoystickSetVirtualButton SDL_JoystickSetVirtualButton_REAL
|
||||
#define SDL_JoystickSetVirtualHat SDL_JoystickSetVirtualHat_REAL
|
||||
#define SDL_AttachVirtualJoystick SDL_AttachVirtualJoystick_REAL
|
||||
#define SDL_DetachVirtualJoystick SDL_DetachVirtualJoystick_REAL
|
||||
#define SDL_IsJoystickVirtual SDL_IsJoystickVirtual_REAL
|
||||
#define SDL_SetJoystickVirtualAxis SDL_SetJoystickVirtualAxis_REAL
|
||||
#define SDL_SetJoystickVirtualButton SDL_SetJoystickVirtualButton_REAL
|
||||
#define SDL_SetJoystickVirtualHat SDL_SetJoystickVirtualHat_REAL
|
||||
#define SDL_GetErrorMsg SDL_GetErrorMsg_REAL
|
||||
#define SDL_LockSensors SDL_LockSensors_REAL
|
||||
#define SDL_UnlockSensors SDL_UnlockSensors_REAL
|
||||
@@ -741,9 +741,9 @@
|
||||
#define SDL_GameControllerHasLED SDL_GameControllerHasLED_REAL
|
||||
#define SDL_GameControllerSetLED SDL_GameControllerSetLED_REAL
|
||||
#define SDL_JoystickHasLED SDL_JoystickHasLED_REAL
|
||||
#define SDL_JoystickSetLED SDL_JoystickSetLED_REAL
|
||||
#define SDL_SetJoystickLED SDL_SetJoystickLED_REAL
|
||||
#define SDL_GameControllerRumbleTriggers SDL_GameControllerRumbleTriggers_REAL
|
||||
#define SDL_JoystickRumbleTriggers SDL_JoystickRumbleTriggers_REAL
|
||||
#define SDL_RumbleJoystickTriggers SDL_RumbleJoystickTriggers_REAL
|
||||
#define SDL_GameControllerHasAxis SDL_GameControllerHasAxis_REAL
|
||||
#define SDL_GameControllerHasButton SDL_GameControllerHasButton_REAL
|
||||
#define SDL_GameControllerGetNumTouchpads SDL_GameControllerGetNumTouchpads_REAL
|
||||
@@ -751,7 +751,7 @@
|
||||
#define SDL_GameControllerGetTouchpadFinger SDL_GameControllerGetTouchpadFinger_REAL
|
||||
#define SDL_crc32 SDL_crc32_REAL
|
||||
#define SDL_GameControllerGetSerial SDL_GameControllerGetSerial_REAL
|
||||
#define SDL_JoystickGetSerial SDL_JoystickGetSerial_REAL
|
||||
#define SDL_GetJoystickSerial SDL_GetJoystickSerial_REAL
|
||||
#define SDL_GameControllerHasSensor SDL_GameControllerHasSensor_REAL
|
||||
#define SDL_GameControllerSetSensorEnabled SDL_GameControllerSetSensorEnabled_REAL
|
||||
#define SDL_GameControllerIsSensorEnabled SDL_GameControllerIsSensorEnabled_REAL
|
||||
@@ -783,7 +783,7 @@
|
||||
#define SDL_SetWindowAlwaysOnTop SDL_SetWindowAlwaysOnTop_REAL
|
||||
#define SDL_FlashWindow SDL_FlashWindow_REAL
|
||||
#define SDL_GameControllerSendEffect SDL_GameControllerSendEffect_REAL
|
||||
#define SDL_JoystickSendEffect SDL_JoystickSendEffect_REAL
|
||||
#define SDL_SendJoystickEffect SDL_SendJoystickEffect_REAL
|
||||
#define SDL_GameControllerGetSensorDataRate SDL_GameControllerGetSensorDataRate_REAL
|
||||
#define SDL_SetTextureUserData SDL_SetTextureUserData_REAL
|
||||
#define SDL_GetTextureUserData SDL_GetTextureUserData_REAL
|
||||
@@ -837,11 +837,11 @@
|
||||
#define SDL_bsearch SDL_bsearch_REAL
|
||||
#define SDL_GameControllerPathForIndex SDL_GameControllerPathForIndex_REAL
|
||||
#define SDL_GameControllerPath SDL_GameControllerPath_REAL
|
||||
#define SDL_JoystickPathForIndex SDL_JoystickPathForIndex_REAL
|
||||
#define SDL_JoystickPath SDL_JoystickPath_REAL
|
||||
#define SDL_JoystickAttachVirtualEx SDL_JoystickAttachVirtualEx_REAL
|
||||
#define SDL_GetJoystickPathForIndex SDL_GetJoystickPathForIndex_REAL
|
||||
#define SDL_GetJoystickPath SDL_GetJoystickPath_REAL
|
||||
#define SDL_AttachVirtualJoystickEx SDL_AttachVirtualJoystickEx_REAL
|
||||
#define SDL_GameControllerGetFirmwareVersion SDL_GameControllerGetFirmwareVersion_REAL
|
||||
#define SDL_JoystickGetFirmwareVersion SDL_JoystickGetFirmwareVersion_REAL
|
||||
#define SDL_GetJoystickFirmwareVersion SDL_GetJoystickFirmwareVersion_REAL
|
||||
#define SDL_GUIDToString SDL_GUIDToString_REAL
|
||||
#define SDL_GUIDFromString SDL_GUIDFromString_REAL
|
||||
#define SDL_HasLSX SDL_HasLSX_REAL
|
||||
|
||||
@@ -209,25 +209,25 @@ SDL_DYNAPI_PROC(const char*,SDL_GetHint,(const char *a),(a),return)
|
||||
SDL_DYNAPI_PROC(void,SDL_AddHintCallback,(const char *a, SDL_HintCallback b, void *c),(a,b,c),)
|
||||
SDL_DYNAPI_PROC(void,SDL_DelHintCallback,(const char *a, SDL_HintCallback b, void *c),(a,b,c),)
|
||||
SDL_DYNAPI_PROC(void,SDL_ClearHints,(void),(),)
|
||||
SDL_DYNAPI_PROC(int,SDL_NumJoysticks,(void),(),return)
|
||||
SDL_DYNAPI_PROC(const char*,SDL_JoystickNameForIndex,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_Joystick*,SDL_JoystickOpen,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(const char*,SDL_JoystickName,(SDL_Joystick *a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_JoystickGUID,SDL_JoystickGetDeviceGUID,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_JoystickGUID,SDL_JoystickGetGUID,(SDL_Joystick *a),(a),return)
|
||||
SDL_DYNAPI_PROC(void,SDL_JoystickGetGUIDString,(SDL_JoystickGUID a, char *b, int c),(a,b,c),)
|
||||
SDL_DYNAPI_PROC(SDL_JoystickGUID,SDL_JoystickGetGUIDFromString,(const char *a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_bool,SDL_JoystickGetAttached,(SDL_Joystick *a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_JoystickID,SDL_JoystickInstanceID,(SDL_Joystick *a),(a),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_JoystickNumAxes,(SDL_Joystick *a),(a),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_JoystickNumHats,(SDL_Joystick *a),(a),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_JoystickNumButtons,(SDL_Joystick *a),(a),return)
|
||||
SDL_DYNAPI_PROC(void,SDL_JoystickUpdate,(void),(),)
|
||||
SDL_DYNAPI_PROC(int,SDL_JoystickEventState,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(Sint16,SDL_JoystickGetAxis,(SDL_Joystick *a, int b),(a,b),return)
|
||||
SDL_DYNAPI_PROC(Uint8,SDL_JoystickGetHat,(SDL_Joystick *a, int b),(a,b),return)
|
||||
SDL_DYNAPI_PROC(Uint8,SDL_JoystickGetButton,(SDL_Joystick *a, int b),(a,b),return)
|
||||
SDL_DYNAPI_PROC(void,SDL_JoystickClose,(SDL_Joystick *a),(a),)
|
||||
SDL_DYNAPI_PROC(int,SDL_GetNumJoysticks,(void),(),return)
|
||||
SDL_DYNAPI_PROC(const char*,SDL_GetJoystickNameForIndex,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_Joystick*,SDL_OpenJoystick,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(const char*,SDL_GetJoystickName,(SDL_Joystick *a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_JoystickGUID,SDL_GetJoystickDeviceGUID,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_JoystickGUID,SDL_GetJoystickGUID,(SDL_Joystick *a),(a),return)
|
||||
SDL_DYNAPI_PROC(void,SDL_GetJoystickGUIDString,(SDL_JoystickGUID a, char *b, int c),(a,b,c),)
|
||||
SDL_DYNAPI_PROC(SDL_JoystickGUID,SDL_GetJoystickGUIDFromString,(const char *a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_bool,SDL_IsJoystickConnected,(SDL_Joystick *a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_JoystickID,SDL_GetJoystickInstanceID,(SDL_Joystick *a),(a),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_GetNumJoystickAxes,(SDL_Joystick *a),(a),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_GetNumJoystickHats,(SDL_Joystick *a),(a),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_GetNumJoystickButtons,(SDL_Joystick *a),(a),return)
|
||||
SDL_DYNAPI_PROC(void,SDL_UpdateJoysticks,(void),(),)
|
||||
SDL_DYNAPI_PROC(int,SDL_GetJoystickEventState,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(Sint16,SDL_GetJoystickAxis,(SDL_Joystick *a, int b),(a,b),return)
|
||||
SDL_DYNAPI_PROC(Uint8,SDL_GetJoystickHat,(SDL_Joystick *a, int b),(a,b),return)
|
||||
SDL_DYNAPI_PROC(Uint8,SDL_GetJoystickButton,(SDL_Joystick *a, int b),(a,b),return)
|
||||
SDL_DYNAPI_PROC(void,SDL_CloseJoystick,(SDL_Joystick *a),(a),)
|
||||
SDL_DYNAPI_PROC(SDL_Window*,SDL_GetKeyboardFocus,(void),(),return)
|
||||
SDL_DYNAPI_PROC(const Uint8*,SDL_GetKeyboardState,(int *a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_Keymod,SDL_GetModState,(void),(),return)
|
||||
@@ -595,9 +595,9 @@ SDL_DYNAPI_PROC(SDL_Window*,SDL_GetGrabbedWindow,(void),(),return)
|
||||
SDL_DYNAPI_PROC(void,SDL_SetWindowsMessageHook,(SDL_WindowsMessageHook a, void *b),(a,b),)
|
||||
#endif
|
||||
SDL_DYNAPI_PROC(int,SDL_GetDisplayDPI,(int a, float *b, float *c, float *d),(a,b,c,d),return)
|
||||
SDL_DYNAPI_PROC(SDL_JoystickPowerLevel,SDL_JoystickCurrentPowerLevel,(SDL_Joystick *a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_JoystickPowerLevel,SDL_GetJoystickPowerLevel,(SDL_Joystick *a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_GameController*,SDL_GameControllerFromInstanceID,(SDL_JoystickID a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_Joystick*,SDL_JoystickFromInstanceID,(SDL_JoystickID a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_Joystick*,SDL_GetJoystickFromInstanceID,(SDL_JoystickID a),(a),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_GetDisplayUsableBounds,(int a, SDL_Rect *b),(a,b),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_GetWindowBordersSize,(SDL_Window *a, int *b, int *c, int *d, int *e),(a,b,c,d,e),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_SetWindowOpacity,(SDL_Window *a, float b),(a,b),return)
|
||||
@@ -611,24 +611,24 @@ SDL_DYNAPI_PROC(void,SDL_SetWindowResizable,(SDL_Window *a, SDL_bool b),(a,b),)
|
||||
SDL_DYNAPI_PROC(SDL_Surface*,SDL_CreateSurface,(int a, int b, Uint32 c),(a,b,c),return)
|
||||
SDL_DYNAPI_PROC(SDL_Surface*,SDL_CreateSurfaceFrom,(void *a, int b, int c, int d, Uint32 e),(a,b,c,d,e),return)
|
||||
SDL_DYNAPI_PROC(SDL_bool,SDL_GetHintBoolean,(const char *a, SDL_bool b),(a,b),return)
|
||||
SDL_DYNAPI_PROC(Uint16,SDL_JoystickGetDeviceVendor,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(Uint16,SDL_JoystickGetDeviceProduct,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(Uint16,SDL_JoystickGetDeviceProductVersion,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(Uint16,SDL_JoystickGetVendor,(SDL_Joystick *a),(a),return)
|
||||
SDL_DYNAPI_PROC(Uint16,SDL_JoystickGetProduct,(SDL_Joystick *a),(a),return)
|
||||
SDL_DYNAPI_PROC(Uint16,SDL_JoystickGetProductVersion,(SDL_Joystick *a),(a),return)
|
||||
SDL_DYNAPI_PROC(Uint16,SDL_GetJoystickDeviceVendor,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(Uint16,SDL_GetJoystickDeviceProduct,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(Uint16,SDL_GetJoystickDeviceProductVersion,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(Uint16,SDL_GetJoystickVendor,(SDL_Joystick *a),(a),return)
|
||||
SDL_DYNAPI_PROC(Uint16,SDL_GetJoystickProduct,(SDL_Joystick *a),(a),return)
|
||||
SDL_DYNAPI_PROC(Uint16,SDL_GetJoystickProductVersion,(SDL_Joystick *a),(a),return)
|
||||
SDL_DYNAPI_PROC(Uint16,SDL_GameControllerGetVendor,(SDL_GameController *a),(a),return)
|
||||
SDL_DYNAPI_PROC(Uint16,SDL_GameControllerGetProduct,(SDL_GameController *a),(a),return)
|
||||
SDL_DYNAPI_PROC(Uint16,SDL_GameControllerGetProductVersion,(SDL_GameController *a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_bool,SDL_HasNEON,(void),(),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_GameControllerNumMappings,(void),(),return)
|
||||
SDL_DYNAPI_PROC(char*,SDL_GameControllerMappingForIndex,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_bool,SDL_JoystickGetAxisInitialState,(SDL_Joystick *a, int b, Sint16 *c),(a,b,c),return)
|
||||
SDL_DYNAPI_PROC(SDL_JoystickType,SDL_JoystickGetDeviceType,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_JoystickType,SDL_JoystickGetType,(SDL_Joystick *a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_bool,SDL_GetJoystickAxisInitialState,(SDL_Joystick *a, int b, Sint16 *c),(a,b,c),return)
|
||||
SDL_DYNAPI_PROC(SDL_JoystickType,SDL_GetJoystickDeviceType,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_JoystickType,SDL_GetJoystickType,(SDL_Joystick *a),(a),return)
|
||||
SDL_DYNAPI_PROC(void,SDL_MemoryBarrierReleaseFunction,(void),(),)
|
||||
SDL_DYNAPI_PROC(void,SDL_MemoryBarrierAcquireFunction,(void),(),)
|
||||
SDL_DYNAPI_PROC(SDL_JoystickID,SDL_JoystickGetDeviceInstanceID,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_JoystickID,SDL_GetJoystickDeviceInstanceID,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(size_t,SDL_utf8strlen,(const char *a),(a),return)
|
||||
SDL_DYNAPI_PROC(void*,SDL_LoadFile_RW,(SDL_RWops *a, size_t *b, int c),(a,b,c),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_wcscmp,(const wchar_t *a, const wchar_t *b),(a,b),return)
|
||||
@@ -692,7 +692,7 @@ SDL_DYNAPI_PROC(double,SDL_exp,(double a),(a),return)
|
||||
SDL_DYNAPI_PROC(float,SDL_expf,(float a),(a),return)
|
||||
SDL_DYNAPI_PROC(wchar_t*,SDL_wcsdup,(const wchar_t *a),(a),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_GameControllerRumble,(SDL_GameController *a, Uint16 b, Uint16 c, Uint32 d),(a,b,c,d),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_JoystickRumble,(SDL_Joystick *a, Uint16 b, Uint16 c, Uint32 d),(a,b,c,d),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_RumbleJoystick,(SDL_Joystick *a, Uint16 b, Uint16 c, Uint32 d),(a,b,c,d),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_NumSensors,(void),(),return)
|
||||
SDL_DYNAPI_PROC(const char*,SDL_SensorGetDeviceName,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_SensorType,SDL_SensorGetDeviceType,(int a),(a),return)
|
||||
@@ -721,8 +721,8 @@ SDL_DYNAPI_PROC(SDL_Thread*,SDL_CreateThreadWithStackSize,(SDL_ThreadFunction a,
|
||||
SDL_DYNAPI_PROC(SDL_Thread*,SDL_CreateThreadWithStackSize,(SDL_ThreadFunction a, const char *b, const size_t c, void *d),(a,b,c,d),return)
|
||||
#endif
|
||||
|
||||
SDL_DYNAPI_PROC(int,SDL_JoystickGetDevicePlayerIndex,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_JoystickGetPlayerIndex,(SDL_Joystick *a),(a),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_GetJoystickDevicePlayerIndex,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_GetJoystickPlayerIndex,(SDL_Joystick *a),(a),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_GameControllerGetPlayerIndex,(SDL_GameController *a),(a),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_RenderFlush,(SDL_Renderer *a),(a),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_RenderDrawPointF,(SDL_Renderer *a, float b, float c),(a,b,c),return)
|
||||
@@ -757,8 +757,8 @@ SDL_DYNAPI_PROC(SDL_GameControllerType,SDL_GameControllerTypeForIndex,(int a),(a
|
||||
SDL_DYNAPI_PROC(SDL_GameControllerType,SDL_GameControllerGetType,(SDL_GameController *a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_GameController*,SDL_GameControllerFromPlayerIndex,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(void,SDL_GameControllerSetPlayerIndex,(SDL_GameController *a, int b),(a,b),)
|
||||
SDL_DYNAPI_PROC(SDL_Joystick*,SDL_JoystickFromPlayerIndex,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(void,SDL_JoystickSetPlayerIndex,(SDL_Joystick *a, int b),(a,b),)
|
||||
SDL_DYNAPI_PROC(SDL_Joystick*,SDL_GetJoystickFromPlayerIndex,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(void,SDL_SetJoystickPlayerIndex,(SDL_Joystick *a, int b),(a,b),)
|
||||
SDL_DYNAPI_PROC(int,SDL_SetTextureScaleMode,(SDL_Texture *a, SDL_ScaleMode b),(a,b),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_GetTextureScaleMode,(SDL_Texture *a, SDL_ScaleMode *b),(a,b),return)
|
||||
SDL_DYNAPI_PROC(void,SDL_OnApplicationWillTerminate,(void),(),)
|
||||
@@ -775,12 +775,12 @@ SDL_DYNAPI_PROC(int,SDL_GetAndroidSDKVersion,(void),(),return)
|
||||
#endif
|
||||
SDL_DYNAPI_PROC(int,SDL_isupper,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_islower,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_JoystickAttachVirtual,(SDL_JoystickType a, int b, int c, int d),(a,b,c,d),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_JoystickDetachVirtual,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_bool,SDL_JoystickIsVirtual,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_JoystickSetVirtualAxis,(SDL_Joystick *a, int b, Sint16 c),(a,b,c),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_JoystickSetVirtualButton,(SDL_Joystick *a, int b, Uint8 c),(a,b,c),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_JoystickSetVirtualHat,(SDL_Joystick *a, int b, Uint8 c),(a,b,c),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_AttachVirtualJoystick,(SDL_JoystickType a, int b, int c, int d),(a,b,c,d),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_DetachVirtualJoystick,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_bool,SDL_IsJoystickVirtual,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_SetJoystickVirtualAxis,(SDL_Joystick *a, int b, Sint16 c),(a,b,c),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_SetJoystickVirtualButton,(SDL_Joystick *a, int b, Uint8 c),(a,b,c),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_SetJoystickVirtualHat,(SDL_Joystick *a, int b, Uint8 c),(a,b,c),return)
|
||||
SDL_DYNAPI_PROC(char*,SDL_GetErrorMsg,(char *a, int b),(a,b),return)
|
||||
SDL_DYNAPI_PROC(void,SDL_LockSensors,(void),(),)
|
||||
SDL_DYNAPI_PROC(void,SDL_UnlockSensors,(void),(),)
|
||||
@@ -798,9 +798,9 @@ SDL_DYNAPI_PROC(SDL_bool,SDL_HasSurfaceRLE,(SDL_Surface *a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_bool,SDL_GameControllerHasLED,(SDL_GameController *a),(a),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_GameControllerSetLED,(SDL_GameController *a, Uint8 b, Uint8 c, Uint8 d),(a,b,c,d),return)
|
||||
SDL_DYNAPI_PROC(SDL_bool,SDL_JoystickHasLED,(SDL_Joystick *a),(a),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_JoystickSetLED,(SDL_Joystick *a, Uint8 b, Uint8 c, Uint8 d),(a,b,c,d),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_SetJoystickLED,(SDL_Joystick *a, Uint8 b, Uint8 c, Uint8 d),(a,b,c,d),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_GameControllerRumbleTriggers,(SDL_GameController *a, Uint16 b, Uint16 c, Uint32 d),(a,b,c,d),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_JoystickRumbleTriggers,(SDL_Joystick *a, Uint16 b, Uint16 c, Uint32 d),(a,b,c,d),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_RumbleJoystickTriggers,(SDL_Joystick *a, Uint16 b, Uint16 c, Uint32 d),(a,b,c,d),return)
|
||||
SDL_DYNAPI_PROC(SDL_bool,SDL_GameControllerHasAxis,(SDL_GameController *a, SDL_GameControllerAxis b),(a,b),return)
|
||||
SDL_DYNAPI_PROC(SDL_bool,SDL_GameControllerHasButton,(SDL_GameController *a, SDL_GameControllerButton b),(a,b),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_GameControllerGetNumTouchpads,(SDL_GameController *a),(a),return)
|
||||
@@ -808,7 +808,7 @@ SDL_DYNAPI_PROC(int,SDL_GameControllerGetNumTouchpadFingers,(SDL_GameController
|
||||
SDL_DYNAPI_PROC(int,SDL_GameControllerGetTouchpadFinger,(SDL_GameController *a, int b, int c, Uint8 *d, float *e, float *f, float *g),(a,b,c,d,e,f,g),return)
|
||||
SDL_DYNAPI_PROC(Uint32,SDL_crc32,(Uint32 a, const void *b, size_t c),(a,b,c),return)
|
||||
SDL_DYNAPI_PROC(const char*,SDL_GameControllerGetSerial,(SDL_GameController *a),(a),return)
|
||||
SDL_DYNAPI_PROC(const char*,SDL_JoystickGetSerial,(SDL_Joystick *a),(a),return)
|
||||
SDL_DYNAPI_PROC(const char*,SDL_GetJoystickSerial,(SDL_Joystick *a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_bool,SDL_GameControllerHasSensor,(SDL_GameController *a, SDL_SensorType b),(a,b),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_GameControllerSetSensorEnabled,(SDL_GameController *a, SDL_SensorType b, SDL_bool c),(a,b,c),return)
|
||||
SDL_DYNAPI_PROC(SDL_bool,SDL_GameControllerIsSensorEnabled,(SDL_GameController *a, SDL_SensorType b),(a,b),return)
|
||||
@@ -844,7 +844,7 @@ SDL_DYNAPI_PROC(void,SDL_TLSCleanup,(void),(),)
|
||||
SDL_DYNAPI_PROC(void,SDL_SetWindowAlwaysOnTop,(SDL_Window *a, SDL_bool b),(a,b),)
|
||||
SDL_DYNAPI_PROC(int,SDL_FlashWindow,(SDL_Window *a, SDL_FlashOperation b),(a,b),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_GameControllerSendEffect,(SDL_GameController *a, const void *b, int c),(a,b,c),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_JoystickSendEffect,(SDL_Joystick *a, const void *b, int c),(a,b,c),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_SendJoystickEffect,(SDL_Joystick *a, const void *b, int c),(a,b,c),return)
|
||||
SDL_DYNAPI_PROC(float,SDL_GameControllerGetSensorDataRate,(SDL_GameController *a, SDL_SensorType b),(a,b),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_SetTextureUserData,(SDL_Texture *a, void *b),(a,b),return)
|
||||
SDL_DYNAPI_PROC(void*,SDL_GetTextureUserData,(SDL_Texture *a),(a),return)
|
||||
@@ -904,11 +904,11 @@ SDL_DYNAPI_PROC(SDL_Window*,SDL_RenderGetWindow,(SDL_Renderer *a),(a),return)
|
||||
SDL_DYNAPI_PROC(void*,SDL_bsearch,(const void *a, const void *b, size_t c, size_t d, int (SDLCALL *e)(const void *, const void *)),(a,b,c,d,e),return)
|
||||
SDL_DYNAPI_PROC(const char*,SDL_GameControllerPathForIndex,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(const char*,SDL_GameControllerPath,(SDL_GameController *a),(a),return)
|
||||
SDL_DYNAPI_PROC(const char*,SDL_JoystickPathForIndex,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(const char*,SDL_JoystickPath,(SDL_Joystick *a),(a),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_JoystickAttachVirtualEx,(const SDL_VirtualJoystickDesc *a),(a),return)
|
||||
SDL_DYNAPI_PROC(const char*,SDL_GetJoystickPathForIndex,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(const char*,SDL_GetJoystickPath,(SDL_Joystick *a),(a),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_AttachVirtualJoystickEx,(const SDL_VirtualJoystickDesc *a),(a),return)
|
||||
SDL_DYNAPI_PROC(Uint16,SDL_GameControllerGetFirmwareVersion,(SDL_GameController *a),(a),return)
|
||||
SDL_DYNAPI_PROC(Uint16,SDL_JoystickGetFirmwareVersion,(SDL_Joystick *a),(a),return)
|
||||
SDL_DYNAPI_PROC(Uint16,SDL_GetJoystickFirmwareVersion,(SDL_Joystick *a),(a),return)
|
||||
SDL_DYNAPI_PROC(void,SDL_GUIDToString,(SDL_GUID a, char *b, int c),(a,b,c),)
|
||||
SDL_DYNAPI_PROC(SDL_GUID,SDL_GUIDFromString,(const char *a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_bool,SDL_HasLSX,(void),(),return)
|
||||
|
||||
@@ -102,7 +102,7 @@ static SDL_bool SDL_update_joysticks = SDL_TRUE;
|
||||
static void SDL_CalculateShouldUpdateJoysticks(SDL_bool hint_value)
|
||||
{
|
||||
if (hint_value &&
|
||||
(!SDL_disabled_events[SDL_JOYAXISMOTION >> 8] || SDL_JoystickEventState(SDL_QUERY))) {
|
||||
(!SDL_disabled_events[SDL_JOYAXISMOTION >> 8] || SDL_GetJoystickEventState(SDL_QUERY))) {
|
||||
SDL_update_joysticks = SDL_TRUE;
|
||||
} else {
|
||||
SDL_update_joysticks = SDL_FALSE;
|
||||
@@ -870,7 +870,7 @@ static void SDL_PumpEventsInternal(SDL_bool push_sentinel)
|
||||
#if !SDL_JOYSTICK_DISABLED
|
||||
/* Check for joystick state change */
|
||||
if (SDL_update_joysticks) {
|
||||
SDL_JoystickUpdate();
|
||||
SDL_UpdateJoysticks();
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1001,7 +1001,7 @@ static SDL_bool SDL_events_need_polling()
|
||||
need_polling =
|
||||
SDL_WasInit(SDL_INIT_JOYSTICK) &&
|
||||
SDL_update_joysticks &&
|
||||
(SDL_NumJoysticks() > 0);
|
||||
(SDL_GetNumJoysticks() > 0);
|
||||
#endif
|
||||
|
||||
#if !SDL_SENSOR_DISABLED
|
||||
|
||||
@@ -297,9 +297,9 @@ static int SDL_DINPUT_HapticOpenFromDevice(SDL_Haptic *haptic, LPDIRECTINPUTDEVI
|
||||
haptic->hwdata->is_joystick = is_joystick;
|
||||
|
||||
/* !!! FIXME: opening a haptic device here first will make an attempt to
|
||||
!!! FIXME: SDL_JoystickOpen() that same device fail later, since we
|
||||
!!! FIXME: SDL_OpenJoystick() that same device fail later, since we
|
||||
!!! FIXME: have it open in exclusive mode. But this will allow
|
||||
!!! FIXME: SDL_JoystickOpen() followed by SDL_HapticOpenFromJoystick()
|
||||
!!! FIXME: SDL_OpenJoystick() followed by SDL_HapticOpenFromJoystick()
|
||||
!!! FIXME: to work, and that's probably the common case. Still,
|
||||
!!! FIXME: ideally, We need to unify the opening code. */
|
||||
|
||||
|
||||
@@ -816,7 +816,7 @@ static ControllerMapping_t *SDL_PrivateGetControllerMappingForGUID(SDL_JoystickG
|
||||
mapping = SDL_CreateMappingForRAWINPUTController(guid);
|
||||
} else if (SDL_IsJoystickWGI(guid)) {
|
||||
mapping = SDL_CreateMappingForWGIController(guid);
|
||||
} else if (SDL_IsJoystickVirtual(guid)) {
|
||||
} else if (SDL_IsJoystickVIRTUAL(guid)) {
|
||||
/* We'll pick up a robust mapping in VIRTUAL_JoystickGetGamepadMapping */
|
||||
#ifdef __ANDROID__
|
||||
} else {
|
||||
@@ -1443,13 +1443,13 @@ static ControllerMapping_t *SDL_PrivateGetControllerMapping(int device_index)
|
||||
|
||||
SDL_AssertJoysticksLocked();
|
||||
|
||||
if ((device_index < 0) || (device_index >= SDL_NumJoysticks())) {
|
||||
SDL_SetError("There are %d joysticks available", SDL_NumJoysticks());
|
||||
if ((device_index < 0) || (device_index >= SDL_GetNumJoysticks())) {
|
||||
SDL_SetError("There are %d joysticks available", SDL_GetNumJoysticks());
|
||||
return NULL;
|
||||
}
|
||||
|
||||
name = SDL_JoystickNameForIndex(device_index);
|
||||
guid = SDL_JoystickGetDeviceGUID(device_index);
|
||||
name = SDL_GetJoystickNameForIndex(device_index);
|
||||
guid = SDL_GetJoystickDeviceGUID(device_index);
|
||||
mapping = SDL_PrivateGetControllerMappingForNameAndGUID(name, guid);
|
||||
if (mapping == NULL) {
|
||||
SDL_GamepadMapping raw_map;
|
||||
@@ -1622,7 +1622,7 @@ static int SDL_PrivateGameControllerAddMapping(const char *mappingString, SDL_Co
|
||||
} else if (!SDL_strcasecmp(pchGUID, "xinput")) {
|
||||
is_xinput_mapping = SDL_TRUE;
|
||||
}
|
||||
jGUID = SDL_JoystickGetGUIDFromString(pchGUID);
|
||||
jGUID = SDL_GetJoystickGUIDFromString(pchGUID);
|
||||
SDL_free(pchGUID);
|
||||
|
||||
pControllerMapping = SDL_PrivateAddMappingForGUID(jGUID, mappingString, &existing, priority);
|
||||
@@ -1693,7 +1693,7 @@ static char *CreateMappingString(ControllerMapping_t *mapping, SDL_JoystickGUID
|
||||
|
||||
SDL_AssertJoysticksLocked();
|
||||
|
||||
SDL_JoystickGetGUIDString(guid, pchGUID, sizeof(pchGUID));
|
||||
SDL_GetJoystickGUIDString(guid, pchGUID, sizeof(pchGUID));
|
||||
|
||||
/* allocate enough memory for GUID + ',' + name + ',' + mapping + \0 */
|
||||
needed = SDL_strlen(pchGUID) + 1 + SDL_strlen(mapping->name) + 1 + SDL_strlen(mapping->mapping) + 1;
|
||||
@@ -1893,7 +1893,7 @@ int SDL_GameControllerInit(void)
|
||||
SDL_AddEventWatch(SDL_GameControllerEventWatcher, NULL);
|
||||
|
||||
/* Send added events for controllers currently attached */
|
||||
for (i = 0; i < SDL_NumJoysticks(); ++i) {
|
||||
for (i = 0; i < SDL_GetNumJoysticks(); ++i) {
|
||||
if (SDL_IsGameController(i)) {
|
||||
SDL_Event deviceevent;
|
||||
deviceevent.type = SDL_CONTROLLERDEVICEADDED;
|
||||
@@ -1918,7 +1918,7 @@ const char *SDL_GameControllerNameForIndex(int joystick_index)
|
||||
ControllerMapping_t *mapping = SDL_PrivateGetControllerMapping(joystick_index);
|
||||
if (mapping != NULL) {
|
||||
if (SDL_strcmp(mapping->name, "*") == 0) {
|
||||
retval = SDL_JoystickNameForIndex(joystick_index);
|
||||
retval = SDL_GetJoystickNameForIndex(joystick_index);
|
||||
} else {
|
||||
retval = mapping->name;
|
||||
}
|
||||
@@ -1940,7 +1940,7 @@ const char *SDL_GameControllerPathForIndex(int joystick_index)
|
||||
{
|
||||
ControllerMapping_t *mapping = SDL_PrivateGetControllerMapping(joystick_index);
|
||||
if (mapping != NULL) {
|
||||
retval = SDL_JoystickPathForIndex(joystick_index);
|
||||
retval = SDL_GetJoystickPathForIndex(joystick_index);
|
||||
}
|
||||
}
|
||||
SDL_UnlockJoysticks();
|
||||
@@ -1953,7 +1953,7 @@ const char *SDL_GameControllerPathForIndex(int joystick_index)
|
||||
*/
|
||||
SDL_GameControllerType SDL_GameControllerTypeForIndex(int joystick_index)
|
||||
{
|
||||
return SDL_GetJoystickGameControllerTypeFromGUID(SDL_JoystickGetDeviceGUID(joystick_index), SDL_JoystickNameForIndex(joystick_index));
|
||||
return SDL_GetJoystickGameControllerTypeFromGUID(SDL_GetJoystickDeviceGUID(joystick_index), SDL_GetJoystickNameForIndex(joystick_index));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1972,8 +1972,8 @@ char *SDL_GameControllerMappingForDeviceIndex(int joystick_index)
|
||||
SDL_JoystickGUID guid;
|
||||
char pchGUID[33];
|
||||
size_t needed;
|
||||
guid = SDL_JoystickGetDeviceGUID(joystick_index);
|
||||
SDL_JoystickGetGUIDString(guid, pchGUID, sizeof(pchGUID));
|
||||
guid = SDL_GetJoystickDeviceGUID(joystick_index);
|
||||
SDL_GetJoystickGUIDString(guid, pchGUID, sizeof(pchGUID));
|
||||
/* allocate enough memory for GUID + ',' + name + ',' + mapping + \0 */
|
||||
needed = SDL_strlen(pchGUID) + 1 + SDL_strlen(mapping->name) + 1 + SDL_strlen(mapping->mapping) + 1;
|
||||
retval = (char *)SDL_malloc(needed);
|
||||
@@ -2138,7 +2138,7 @@ SDL_GameController *SDL_GameControllerOpen(int joystick_index)
|
||||
|
||||
gamecontrollerlist = SDL_gamecontrollers;
|
||||
/* If the controller is already open, return it */
|
||||
instance_id = SDL_JoystickGetDeviceInstanceID(joystick_index);
|
||||
instance_id = SDL_GetJoystickDeviceInstanceID(joystick_index);
|
||||
while (gamecontrollerlist != NULL) {
|
||||
if (instance_id == gamecontrollerlist->joystick->instance_id) {
|
||||
gamecontroller = gamecontrollerlist;
|
||||
@@ -2166,7 +2166,7 @@ SDL_GameController *SDL_GameControllerOpen(int joystick_index)
|
||||
}
|
||||
gamecontroller->magic = &gamecontroller_magic;
|
||||
|
||||
gamecontroller->joystick = SDL_JoystickOpen(joystick_index);
|
||||
gamecontroller->joystick = SDL_OpenJoystick(joystick_index);
|
||||
if (gamecontroller->joystick == NULL) {
|
||||
SDL_free(gamecontroller);
|
||||
SDL_UnlockJoysticks();
|
||||
@@ -2177,7 +2177,7 @@ SDL_GameController *SDL_GameControllerOpen(int joystick_index)
|
||||
gamecontroller->last_match_axis = (SDL_ExtendedGameControllerBind **)SDL_calloc(gamecontroller->joystick->naxes, sizeof(*gamecontroller->last_match_axis));
|
||||
if (!gamecontroller->last_match_axis) {
|
||||
SDL_OutOfMemory();
|
||||
SDL_JoystickClose(gamecontroller->joystick);
|
||||
SDL_CloseJoystick(gamecontroller->joystick);
|
||||
SDL_free(gamecontroller);
|
||||
SDL_UnlockJoysticks();
|
||||
return NULL;
|
||||
@@ -2187,7 +2187,7 @@ SDL_GameController *SDL_GameControllerOpen(int joystick_index)
|
||||
gamecontroller->last_hat_mask = (Uint8 *)SDL_calloc(gamecontroller->joystick->nhats, sizeof(*gamecontroller->last_hat_mask));
|
||||
if (!gamecontroller->last_hat_mask) {
|
||||
SDL_OutOfMemory();
|
||||
SDL_JoystickClose(gamecontroller->joystick);
|
||||
SDL_CloseJoystick(gamecontroller->joystick);
|
||||
SDL_free(gamecontroller->last_match_axis);
|
||||
SDL_free(gamecontroller);
|
||||
SDL_UnlockJoysticks();
|
||||
@@ -2214,7 +2214,7 @@ SDL_GameController *SDL_GameControllerOpen(int joystick_index)
|
||||
void SDL_GameControllerUpdate(void)
|
||||
{
|
||||
/* Just for API completeness; the joystick API does all the work. */
|
||||
SDL_JoystickUpdate();
|
||||
SDL_UpdateJoysticks();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2256,7 +2256,7 @@ Sint16 SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, SDL_GameCon
|
||||
SDL_bool valid_output_range;
|
||||
|
||||
if (binding->inputType == SDL_CONTROLLER_BINDTYPE_AXIS) {
|
||||
value = SDL_JoystickGetAxis(gamecontroller->joystick, binding->input.axis.axis);
|
||||
value = SDL_GetJoystickAxis(gamecontroller->joystick, binding->input.axis.axis);
|
||||
if (binding->input.axis.axis_min < binding->input.axis.axis_max) {
|
||||
valid_input_range = (value >= binding->input.axis.axis_min && value <= binding->input.axis.axis_max);
|
||||
} else {
|
||||
@@ -2271,12 +2271,12 @@ Sint16 SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, SDL_GameCon
|
||||
value = 0;
|
||||
}
|
||||
} else if (binding->inputType == SDL_CONTROLLER_BINDTYPE_BUTTON) {
|
||||
value = SDL_JoystickGetButton(gamecontroller->joystick, binding->input.button);
|
||||
value = SDL_GetJoystickButton(gamecontroller->joystick, binding->input.button);
|
||||
if (value == SDL_PRESSED) {
|
||||
value = binding->output.axis.axis_max;
|
||||
}
|
||||
} else if (binding->inputType == SDL_CONTROLLER_BINDTYPE_HAT) {
|
||||
int hat_mask = SDL_JoystickGetHat(gamecontroller->joystick, binding->input.hat.hat);
|
||||
int hat_mask = SDL_GetJoystickHat(gamecontroller->joystick, binding->input.hat.hat);
|
||||
if (hat_mask & binding->input.hat.hat_mask) {
|
||||
value = binding->output.axis.axis_max;
|
||||
}
|
||||
@@ -2337,7 +2337,7 @@ Uint8 SDL_GameControllerGetButton(SDL_GameController *gamecontroller, SDL_GameCo
|
||||
if (binding->inputType == SDL_CONTROLLER_BINDTYPE_AXIS) {
|
||||
SDL_bool valid_input_range;
|
||||
|
||||
int value = SDL_JoystickGetAxis(gamecontroller->joystick, binding->input.axis.axis);
|
||||
int value = SDL_GetJoystickAxis(gamecontroller->joystick, binding->input.axis.axis);
|
||||
int threshold = binding->input.axis.axis_min + (binding->input.axis.axis_max - binding->input.axis.axis_min) / 2;
|
||||
if (binding->input.axis.axis_min < binding->input.axis.axis_max) {
|
||||
valid_input_range = (value >= binding->input.axis.axis_min && value <= binding->input.axis.axis_max);
|
||||
@@ -2353,10 +2353,10 @@ Uint8 SDL_GameControllerGetButton(SDL_GameController *gamecontroller, SDL_GameCo
|
||||
}
|
||||
}
|
||||
} else if (binding->inputType == SDL_CONTROLLER_BINDTYPE_BUTTON) {
|
||||
retval = SDL_JoystickGetButton(gamecontroller->joystick, binding->input.button);
|
||||
retval = SDL_GetJoystickButton(gamecontroller->joystick, binding->input.button);
|
||||
break;
|
||||
} else if (binding->inputType == SDL_CONTROLLER_BINDTYPE_HAT) {
|
||||
int hat_mask = SDL_JoystickGetHat(gamecontroller->joystick, binding->input.hat.hat);
|
||||
int hat_mask = SDL_GetJoystickHat(gamecontroller->joystick, binding->input.hat.hat);
|
||||
retval = (hat_mask & binding->input.hat.hat_mask) ? SDL_PRESSED : SDL_RELEASED;
|
||||
break;
|
||||
}
|
||||
@@ -2614,7 +2614,7 @@ const char *SDL_GameControllerName(SDL_GameController *gamecontroller)
|
||||
CHECK_GAMECONTROLLER_MAGIC(gamecontroller, NULL);
|
||||
|
||||
if (SDL_strcmp(gamecontroller->name, "*") == 0) {
|
||||
retval = SDL_JoystickName(gamecontroller->joystick);
|
||||
retval = SDL_GetJoystickName(gamecontroller->joystick);
|
||||
} else {
|
||||
retval = gamecontroller->name;
|
||||
}
|
||||
@@ -2631,7 +2631,7 @@ const char *SDL_GameControllerPath(SDL_GameController *gamecontroller)
|
||||
if (joystick == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
return SDL_JoystickPath(joystick);
|
||||
return SDL_GetJoystickPath(joystick);
|
||||
}
|
||||
|
||||
SDL_GameControllerType SDL_GameControllerGetType(SDL_GameController *gamecontroller)
|
||||
@@ -2641,7 +2641,7 @@ SDL_GameControllerType SDL_GameControllerGetType(SDL_GameController *gamecontrol
|
||||
if (joystick == NULL) {
|
||||
return SDL_CONTROLLER_TYPE_UNKNOWN;
|
||||
}
|
||||
return SDL_GetJoystickGameControllerTypeFromGUID(SDL_JoystickGetGUID(joystick), SDL_JoystickName(joystick));
|
||||
return SDL_GetJoystickGameControllerTypeFromGUID(SDL_GetJoystickGUID(joystick), SDL_GetJoystickName(joystick));
|
||||
}
|
||||
|
||||
int SDL_GameControllerGetPlayerIndex(SDL_GameController *gamecontroller)
|
||||
@@ -2651,7 +2651,7 @@ int SDL_GameControllerGetPlayerIndex(SDL_GameController *gamecontroller)
|
||||
if (joystick == NULL) {
|
||||
return -1;
|
||||
}
|
||||
return SDL_JoystickGetPlayerIndex(joystick);
|
||||
return SDL_GetJoystickPlayerIndex(joystick);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2664,7 +2664,7 @@ void SDL_GameControllerSetPlayerIndex(SDL_GameController *gamecontroller, int pl
|
||||
if (joystick == NULL) {
|
||||
return;
|
||||
}
|
||||
SDL_JoystickSetPlayerIndex(joystick, player_index);
|
||||
SDL_SetJoystickPlayerIndex(joystick, player_index);
|
||||
}
|
||||
|
||||
Uint16 SDL_GameControllerGetVendor(SDL_GameController *gamecontroller)
|
||||
@@ -2674,7 +2674,7 @@ Uint16 SDL_GameControllerGetVendor(SDL_GameController *gamecontroller)
|
||||
if (joystick == NULL) {
|
||||
return 0;
|
||||
}
|
||||
return SDL_JoystickGetVendor(joystick);
|
||||
return SDL_GetJoystickVendor(joystick);
|
||||
}
|
||||
|
||||
Uint16 SDL_GameControllerGetProduct(SDL_GameController *gamecontroller)
|
||||
@@ -2684,7 +2684,7 @@ Uint16 SDL_GameControllerGetProduct(SDL_GameController *gamecontroller)
|
||||
if (joystick == NULL) {
|
||||
return 0;
|
||||
}
|
||||
return SDL_JoystickGetProduct(joystick);
|
||||
return SDL_GetJoystickProduct(joystick);
|
||||
}
|
||||
|
||||
Uint16 SDL_GameControllerGetProductVersion(SDL_GameController *gamecontroller)
|
||||
@@ -2694,7 +2694,7 @@ Uint16 SDL_GameControllerGetProductVersion(SDL_GameController *gamecontroller)
|
||||
if (joystick == NULL) {
|
||||
return 0;
|
||||
}
|
||||
return SDL_JoystickGetProductVersion(joystick);
|
||||
return SDL_GetJoystickProductVersion(joystick);
|
||||
}
|
||||
|
||||
Uint16 SDL_GameControllerGetFirmwareVersion(SDL_GameController *gamecontroller)
|
||||
@@ -2704,7 +2704,7 @@ Uint16 SDL_GameControllerGetFirmwareVersion(SDL_GameController *gamecontroller)
|
||||
if (joystick == NULL) {
|
||||
return 0;
|
||||
}
|
||||
return SDL_JoystickGetFirmwareVersion(joystick);
|
||||
return SDL_GetJoystickFirmwareVersion(joystick);
|
||||
}
|
||||
|
||||
const char * SDL_GameControllerGetSerial(SDL_GameController *gamecontroller)
|
||||
@@ -2714,7 +2714,7 @@ const char * SDL_GameControllerGetSerial(SDL_GameController *gamecontroller)
|
||||
if (joystick == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
return SDL_JoystickGetSerial(joystick);
|
||||
return SDL_GetJoystickSerial(joystick);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2728,7 +2728,7 @@ SDL_bool SDL_GameControllerGetAttached(SDL_GameController *gamecontroller)
|
||||
if (joystick == NULL) {
|
||||
return SDL_FALSE;
|
||||
}
|
||||
return SDL_JoystickGetAttached(joystick);
|
||||
return SDL_IsJoystickConnected(joystick);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2778,7 +2778,7 @@ SDL_GameController *SDL_GameControllerFromPlayerIndex(int player_index)
|
||||
|
||||
SDL_LockJoysticks();
|
||||
{
|
||||
SDL_Joystick *joystick = SDL_JoystickFromPlayerIndex(player_index);
|
||||
SDL_Joystick *joystick = SDL_GetJoystickFromPlayerIndex(player_index);
|
||||
if (joystick) {
|
||||
retval = SDL_GameControllerFromInstanceID(joystick->instance_id);
|
||||
}
|
||||
@@ -2870,7 +2870,7 @@ int SDL_GameControllerRumble(SDL_GameController *gamecontroller, Uint16 low_freq
|
||||
if (joystick == NULL) {
|
||||
return -1;
|
||||
}
|
||||
return SDL_JoystickRumble(joystick, low_frequency_rumble, high_frequency_rumble, duration_ms);
|
||||
return SDL_RumbleJoystick(joystick, low_frequency_rumble, high_frequency_rumble, duration_ms);
|
||||
}
|
||||
|
||||
int SDL_GameControllerRumbleTriggers(SDL_GameController *gamecontroller, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms)
|
||||
@@ -2880,7 +2880,7 @@ int SDL_GameControllerRumbleTriggers(SDL_GameController *gamecontroller, Uint16
|
||||
if (joystick == NULL) {
|
||||
return -1;
|
||||
}
|
||||
return SDL_JoystickRumbleTriggers(joystick, left_rumble, right_rumble, duration_ms);
|
||||
return SDL_RumbleJoystickTriggers(joystick, left_rumble, right_rumble, duration_ms);
|
||||
}
|
||||
|
||||
SDL_bool SDL_GameControllerHasLED(SDL_GameController *gamecontroller)
|
||||
@@ -2920,7 +2920,7 @@ int SDL_GameControllerSetLED(SDL_GameController *gamecontroller, Uint8 red, Uint
|
||||
if (joystick == NULL) {
|
||||
return -1;
|
||||
}
|
||||
return SDL_JoystickSetLED(joystick, red, green, blue);
|
||||
return SDL_SetJoystickLED(joystick, red, green, blue);
|
||||
}
|
||||
|
||||
int SDL_GameControllerSendEffect(SDL_GameController *gamecontroller, const void *data, int size)
|
||||
@@ -2930,7 +2930,7 @@ int SDL_GameControllerSendEffect(SDL_GameController *gamecontroller, const void
|
||||
if (joystick == NULL) {
|
||||
return -1;
|
||||
}
|
||||
return SDL_JoystickSendEffect(joystick, data, size);
|
||||
return SDL_SendJoystickEffect(joystick, data, size);
|
||||
}
|
||||
|
||||
void SDL_GameControllerClose(SDL_GameController *gamecontroller)
|
||||
@@ -2950,7 +2950,7 @@ void SDL_GameControllerClose(SDL_GameController *gamecontroller)
|
||||
return;
|
||||
}
|
||||
|
||||
SDL_JoystickClose(gamecontroller->joystick);
|
||||
SDL_CloseJoystick(gamecontroller->joystick);
|
||||
|
||||
gamecontrollerlist = SDL_gamecontrollers;
|
||||
gamecontrollerlistprev = NULL;
|
||||
|
||||
+75
-75
File diff suppressed because it is too large
Load Diff
@@ -132,7 +132,7 @@ extern SDL_bool SDL_IsJoystickHIDAPI(SDL_JoystickGUID guid);
|
||||
extern SDL_bool SDL_IsJoystickRAWINPUT(SDL_JoystickGUID guid);
|
||||
|
||||
/* Function to return whether a joystick guid comes from the Virtual driver */
|
||||
extern SDL_bool SDL_IsJoystickVirtual(SDL_JoystickGUID guid);
|
||||
extern SDL_bool SDL_IsJoystickVIRTUAL(SDL_JoystickGUID guid);
|
||||
|
||||
/* Function to return whether a joystick should be ignored */
|
||||
extern SDL_bool SDL_ShouldIgnoreJoystick(const char *name, SDL_JoystickGUID guid);
|
||||
|
||||
@@ -244,7 +244,7 @@ static void HIDAPI_DriverGameCube_HandleJoystickPacket(SDL_HIDAPI_Device *device
|
||||
return; /* How do we handle this packet? */
|
||||
}
|
||||
|
||||
joystick = SDL_JoystickFromInstanceID(ctx->joysticks[i]);
|
||||
joystick = SDL_GetJoystickFromInstanceID(ctx->joysticks[i]);
|
||||
if (joystick == NULL) {
|
||||
/* Hasn't been opened yet, skip */
|
||||
return;
|
||||
@@ -319,7 +319,7 @@ static void HIDAPI_DriverGameCube_HandleNintendoPacket(SDL_HIDAPI_Device *device
|
||||
ResetAxisRange(ctx, i);
|
||||
HIDAPI_JoystickConnected(device, &ctx->joysticks[i]);
|
||||
}
|
||||
joystick = SDL_JoystickFromInstanceID(ctx->joysticks[i]);
|
||||
joystick = SDL_GetJoystickFromInstanceID(ctx->joysticks[i]);
|
||||
|
||||
/* Hasn't been opened yet, skip */
|
||||
if (joystick == NULL) {
|
||||
|
||||
@@ -385,7 +385,7 @@ static SDL_bool HIDAPI_DriverLuna_UpdateDevice(SDL_HIDAPI_Device *device)
|
||||
int size = 0;
|
||||
|
||||
if (device->num_joysticks > 0) {
|
||||
joystick = SDL_JoystickFromInstanceID(device->joysticks[0]);
|
||||
joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]);
|
||||
} else {
|
||||
return SDL_FALSE;
|
||||
}
|
||||
|
||||
@@ -238,7 +238,7 @@ static SDL_bool HIDAPI_DriverPS3_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joy
|
||||
SDL_zeroa(ctx->last_state);
|
||||
|
||||
/* Initialize player index (needed for setting LEDs) */
|
||||
ctx->player_index = SDL_JoystickGetPlayerIndex(joystick);
|
||||
ctx->player_index = SDL_GetJoystickPlayerIndex(joystick);
|
||||
|
||||
/* Initialize the joystick capabilities */
|
||||
joystick->nbuttons = 15;
|
||||
@@ -482,7 +482,7 @@ static SDL_bool HIDAPI_DriverPS3_UpdateDevice(SDL_HIDAPI_Device *device)
|
||||
int size;
|
||||
|
||||
if (device->num_joysticks > 0) {
|
||||
joystick = SDL_JoystickFromInstanceID(device->joysticks[0]);
|
||||
joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]);
|
||||
} else {
|
||||
return SDL_FALSE;
|
||||
}
|
||||
@@ -796,7 +796,7 @@ static SDL_bool HIDAPI_DriverPS3ThirdParty_UpdateDevice(SDL_HIDAPI_Device *devic
|
||||
int size;
|
||||
|
||||
if (device->num_joysticks > 0) {
|
||||
joystick = SDL_JoystickFromInstanceID(device->joysticks[0]);
|
||||
joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]);
|
||||
} else {
|
||||
return SDL_FALSE;
|
||||
}
|
||||
|
||||
@@ -676,7 +676,7 @@ static SDL_bool HIDAPI_DriverPS4_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joy
|
||||
SDL_zero(ctx->last_state);
|
||||
|
||||
/* Initialize player index (needed for setting LEDs) */
|
||||
ctx->player_index = SDL_JoystickGetPlayerIndex(joystick);
|
||||
ctx->player_index = SDL_GetJoystickPlayerIndex(joystick);
|
||||
|
||||
/* Initialize the joystick capabilities */
|
||||
joystick->nbuttons = ctx->touchpad_supported ? 16 : 15;
|
||||
@@ -1041,7 +1041,7 @@ static SDL_bool HIDAPI_DriverPS4_UpdateDevice(SDL_HIDAPI_Device *device)
|
||||
Uint64 now = SDL_GetTicks();
|
||||
|
||||
if (device->num_joysticks > 0) {
|
||||
joystick = SDL_JoystickFromInstanceID(device->joysticks[0]);
|
||||
joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]);
|
||||
}
|
||||
|
||||
while ((size = SDL_hid_read_timeout(device->dev, data, sizeof(data), 0)) > 0) {
|
||||
|
||||
@@ -831,7 +831,7 @@ static SDL_bool HIDAPI_DriverPS5_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joy
|
||||
SDL_zero(ctx->last_state);
|
||||
|
||||
/* Initialize player index (needed for setting LEDs) */
|
||||
ctx->player_index = SDL_JoystickGetPlayerIndex(joystick);
|
||||
ctx->player_index = SDL_GetJoystickPlayerIndex(joystick);
|
||||
ctx->player_lights = SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED, SDL_TRUE);
|
||||
|
||||
/* Initialize the joystick capabilities */
|
||||
@@ -1331,7 +1331,7 @@ static SDL_bool HIDAPI_DriverPS5_UpdateDevice(SDL_HIDAPI_Device *device)
|
||||
Uint64 now = SDL_GetTicks();
|
||||
|
||||
if (device->num_joysticks > 0) {
|
||||
joystick = SDL_JoystickFromInstanceID(device->joysticks[0]);
|
||||
joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]);
|
||||
}
|
||||
|
||||
while ((size = SDL_hid_read_timeout(device->dev, data, sizeof(data), 0)) > 0) {
|
||||
|
||||
@@ -477,7 +477,7 @@ static SDL_bool HIDAPI_DriverShield_UpdateDevice(SDL_HIDAPI_Device *device)
|
||||
ShieldCommandReport_t *cmd_resp_report;
|
||||
|
||||
if (device->num_joysticks > 0) {
|
||||
joystick = SDL_JoystickFromInstanceID(device->joysticks[0]);
|
||||
joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]);
|
||||
} else {
|
||||
return SDL_FALSE;
|
||||
}
|
||||
|
||||
@@ -254,7 +254,7 @@ static SDL_bool HIDAPI_DriverStadia_UpdateDevice(SDL_HIDAPI_Device *device)
|
||||
int size = 0;
|
||||
|
||||
if (device->num_joysticks > 0) {
|
||||
joystick = SDL_JoystickFromInstanceID(device->joysticks[0]);
|
||||
joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]);
|
||||
} else {
|
||||
return SDL_FALSE;
|
||||
}
|
||||
|
||||
@@ -1092,7 +1092,7 @@ static SDL_bool HIDAPI_DriverSteam_UpdateDevice(SDL_HIDAPI_Device *device)
|
||||
SDL_Joystick *joystick = NULL;
|
||||
|
||||
if (device->num_joysticks > 0) {
|
||||
joystick = SDL_JoystickFromInstanceID(device->joysticks[0]);
|
||||
joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]);
|
||||
} else {
|
||||
return SDL_FALSE;
|
||||
}
|
||||
|
||||
@@ -1356,7 +1356,7 @@ static SDL_bool HIDAPI_DriverSwitch_OpenJoystick(SDL_HIDAPI_Device *device, SDL_
|
||||
}
|
||||
|
||||
/* Initialize player index (needed for setting LEDs) */
|
||||
ctx->m_nPlayerIndex = SDL_JoystickGetPlayerIndex(joystick);
|
||||
ctx->m_nPlayerIndex = SDL_GetJoystickPlayerIndex(joystick);
|
||||
ctx->m_bPlayerLights = SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED, SDL_TRUE);
|
||||
UpdateSlotLED(ctx);
|
||||
|
||||
@@ -2081,7 +2081,7 @@ static SDL_bool HIDAPI_DriverSwitch_UpdateDevice(SDL_HIDAPI_Device *device)
|
||||
Uint64 now = SDL_GetTicks();
|
||||
|
||||
if (device->num_joysticks > 0) {
|
||||
joystick = SDL_JoystickFromInstanceID(device->joysticks[0]);
|
||||
joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]);
|
||||
}
|
||||
|
||||
while ((size = ReadInput(ctx)) > 0) {
|
||||
|
||||
@@ -790,7 +790,7 @@ static SDL_bool HIDAPI_DriverWii_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joy
|
||||
SDL_GameControllerButtonReportingHintChanged, ctx);
|
||||
|
||||
/* Initialize player index (needed for setting LEDs) */
|
||||
ctx->m_nPlayerIndex = SDL_JoystickGetPlayerIndex(joystick);
|
||||
ctx->m_nPlayerIndex = SDL_GetJoystickPlayerIndex(joystick);
|
||||
ctx->m_bPlayerLights = SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_WII_PLAYER_LED, SDL_TRUE);
|
||||
UpdateSlotLED(ctx);
|
||||
|
||||
@@ -1574,7 +1574,7 @@ static SDL_bool HIDAPI_DriverWii_UpdateDevice(SDL_HIDAPI_Device *device)
|
||||
Uint64 now;
|
||||
|
||||
if (device->num_joysticks > 0) {
|
||||
joystick = SDL_JoystickFromInstanceID(device->joysticks[0]);
|
||||
joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]);
|
||||
} else {
|
||||
return SDL_FALSE;
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ static SDL_bool HIDAPI_DriverXbox360_OpenJoystick(SDL_HIDAPI_Device *device, SDL
|
||||
SDL_zeroa(ctx->last_state);
|
||||
|
||||
/* Initialize player index (needed for setting LEDs) */
|
||||
ctx->player_index = SDL_JoystickGetPlayerIndex(joystick);
|
||||
ctx->player_index = SDL_GetJoystickPlayerIndex(joystick);
|
||||
ctx->player_lights = SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED, SDL_TRUE);
|
||||
UpdateSlotLED(ctx);
|
||||
|
||||
@@ -318,7 +318,7 @@ static SDL_bool HIDAPI_DriverXbox360_UpdateDevice(SDL_HIDAPI_Device *device)
|
||||
int size = 0;
|
||||
|
||||
if (device->num_joysticks > 0) {
|
||||
joystick = SDL_JoystickFromInstanceID(device->joysticks[0]);
|
||||
joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]);
|
||||
} else {
|
||||
return SDL_FALSE;
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ static SDL_bool HIDAPI_DriverXbox360W_OpenJoystick(SDL_HIDAPI_Device *device, SD
|
||||
SDL_zeroa(ctx->last_state);
|
||||
|
||||
/* Initialize player index (needed for setting LEDs) */
|
||||
ctx->player_index = SDL_JoystickGetPlayerIndex(joystick);
|
||||
ctx->player_index = SDL_GetJoystickPlayerIndex(joystick);
|
||||
ctx->player_lights = SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED, SDL_TRUE);
|
||||
UpdateSlotLED(ctx);
|
||||
|
||||
@@ -287,7 +287,7 @@ static SDL_bool HIDAPI_DriverXbox360W_UpdateDevice(SDL_HIDAPI_Device *device)
|
||||
int size;
|
||||
|
||||
if (device->num_joysticks > 0) {
|
||||
joystick = SDL_JoystickFromInstanceID(device->joysticks[0]);
|
||||
joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]);
|
||||
}
|
||||
|
||||
while ((size = SDL_hid_read_timeout(device->dev, data, sizeof(data), 0)) > 0) {
|
||||
|
||||
@@ -1132,7 +1132,7 @@ static SDL_bool HIDAPI_DriverXboxOne_UpdateDevice(SDL_HIDAPI_Device *device)
|
||||
int size;
|
||||
|
||||
if (device->num_joysticks > 0) {
|
||||
joystick = SDL_JoystickFromInstanceID(device->joysticks[0]);
|
||||
joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]);
|
||||
} else {
|
||||
return SDL_FALSE;
|
||||
}
|
||||
|
||||
@@ -667,7 +667,7 @@ void HIDAPI_JoystickDisconnected(SDL_HIDAPI_Device *device, SDL_JoystickID joyst
|
||||
|
||||
for (i = 0; i < device->num_joysticks; ++i) {
|
||||
if (device->joysticks[i] == joystickID) {
|
||||
SDL_Joystick *joystick = SDL_JoystickFromInstanceID(joystickID);
|
||||
SDL_Joystick *joystick = SDL_GetJoystickFromInstanceID(joystickID);
|
||||
if (joystick) {
|
||||
HIDAPI_JoystickClose(joystick);
|
||||
}
|
||||
|
||||
@@ -1681,7 +1681,7 @@ static SDL_bool LINUX_JoystickGetGamepadMapping(int device_index, SDL_GamepadMap
|
||||
}
|
||||
|
||||
/* Xbox controllers use BTN_X and BTN_Y, and PS4 controllers use BTN_WEST and BTN_NORTH */
|
||||
if (SDL_JoystickGetVendor(joystick) == USB_VENDOR_SONY) {
|
||||
if (SDL_GetJoystickVendor(joystick) == USB_VENDOR_SONY) {
|
||||
if (joystick->hwdata->has_key[BTN_WEST]) {
|
||||
out->x.kind = EMappingKind_Button;
|
||||
out->x.target = joystick->hwdata->key_map[BTN_WEST];
|
||||
|
||||
@@ -226,7 +226,7 @@ static void VITA_JoystickUpdate(SDL_Joystick *joystick)
|
||||
SceCtrlData *pad = NULL;
|
||||
Uint64 timestamp = SDL_GetTicksNS();
|
||||
|
||||
int index = (int)SDL_JoystickInstanceID(joystick);
|
||||
int index = (int)SDL_GetJoystickInstanceID(joystick);
|
||||
|
||||
if (index == 0)
|
||||
pad = &pad0;
|
||||
@@ -319,7 +319,7 @@ SDL_JoystickGUID VITA_JoystickGetDeviceGUID(int device_index)
|
||||
|
||||
static int VITA_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble)
|
||||
{
|
||||
int index = (int)SDL_JoystickInstanceID(joystick);
|
||||
int index = (int)SDL_GetJoystickInstanceID(joystick);
|
||||
SceCtrlActuator act;
|
||||
SDL_zero(act);
|
||||
|
||||
@@ -344,7 +344,7 @@ static Uint32 VITA_JoystickGetCapabilities(SDL_Joystick *joystick)
|
||||
|
||||
static int VITA_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue)
|
||||
{
|
||||
int index = (int)SDL_JoystickInstanceID(joystick);
|
||||
int index = (int)SDL_GetJoystickInstanceID(joystick);
|
||||
if (sceCtrlSetLightBar(ext_port_map[index], red, green, blue) < 0) {
|
||||
return SDL_Unsupported();
|
||||
}
|
||||
|
||||
+23
-23
@@ -368,11 +368,11 @@ WatchJoystick(SDL_Joystick *joystick)
|
||||
SDL_RenderSetLogicalSize(screen, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
|
||||
/* Print info about the joystick we are watching */
|
||||
name = SDL_JoystickName(joystick);
|
||||
SDL_Log("Watching joystick %" SDL_PRIs32 ": (%s)\n", SDL_JoystickInstanceID(joystick),
|
||||
name = SDL_GetJoystickName(joystick);
|
||||
SDL_Log("Watching joystick %" SDL_PRIs32 ": (%s)\n", SDL_GetJoystickInstanceID(joystick),
|
||||
name ? name : "Unknown Joystick");
|
||||
SDL_Log("Joystick has %d axes, %d hats, and %d buttons\n",
|
||||
SDL_JoystickNumAxes(joystick), SDL_JoystickNumHats(joystick), SDL_JoystickNumButtons(joystick));
|
||||
SDL_GetNumJoystickAxes(joystick), SDL_GetNumJoystickHats(joystick), SDL_GetNumJoystickButtons(joystick));
|
||||
|
||||
SDL_Log("\n\n\
|
||||
====================================================================================\n\
|
||||
@@ -383,9 +383,9 @@ WatchJoystick(SDL_Joystick *joystick)
|
||||
To exit, press ESC\n\
|
||||
====================================================================================\n");
|
||||
|
||||
nJoystickID = SDL_JoystickInstanceID(joystick);
|
||||
nJoystickID = SDL_GetJoystickInstanceID(joystick);
|
||||
|
||||
s_nNumAxes = SDL_JoystickNumAxes(joystick);
|
||||
s_nNumAxes = SDL_GetNumJoystickAxes(joystick);
|
||||
s_arrAxisState = (AxisState *)SDL_calloc(s_nNumAxes, sizeof(*s_arrAxisState));
|
||||
|
||||
/* Skip any spurious events at start */
|
||||
@@ -448,7 +448,7 @@ WatchJoystick(SDL_Joystick *joystick)
|
||||
int nCurrentDistance, nFarthestDistance;
|
||||
if (!pAxisState->m_bMoving) {
|
||||
Sint16 nInitialValue;
|
||||
pAxisState->m_bMoving = SDL_JoystickGetAxisInitialState(joystick, event.jaxis.axis, &nInitialValue);
|
||||
pAxisState->m_bMoving = SDL_GetJoystickAxisInitialState(joystick, event.jaxis.axis, &nInitialValue);
|
||||
pAxisState->m_nLastValue = nValue;
|
||||
pAxisState->m_nStartingValue = nInitialValue;
|
||||
pAxisState->m_nFarthestValue = nInitialValue;
|
||||
@@ -570,14 +570,14 @@ WatchJoystick(SDL_Joystick *joystick)
|
||||
}
|
||||
|
||||
/* Initialize mapping with GUID and name */
|
||||
guid = SDL_JoystickGetGUID(joystick);
|
||||
guid = SDL_GetJoystickGUID(joystick);
|
||||
SDL_GetJoystickGUIDInfo(guid, NULL, NULL, NULL, &crc);
|
||||
if (crc) {
|
||||
/* Clear the CRC from the GUID for the mapping */
|
||||
guid.data[2] = 0;
|
||||
guid.data[3] = 0;
|
||||
}
|
||||
SDL_JoystickGetGUIDString(guid, mapping, SDL_arraysize(mapping));
|
||||
SDL_GetJoystickGUIDString(guid, mapping, SDL_arraysize(mapping));
|
||||
SDL_strlcat(mapping, ",", SDL_arraysize(mapping));
|
||||
SDL_strlcat(mapping, trimmed_name, SDL_arraysize(mapping));
|
||||
SDL_strlcat(mapping, ",", SDL_arraysize(mapping));
|
||||
@@ -737,7 +737,7 @@ int main(int argc, char *argv[])
|
||||
return 2;
|
||||
}
|
||||
|
||||
while (!done && SDL_NumJoysticks() == 0) {
|
||||
while (!done && SDL_GetNumJoysticks() == 0) {
|
||||
SDL_Event event;
|
||||
|
||||
while (SDL_PollEvent(&event) > 0) {
|
||||
@@ -758,25 +758,25 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
/* Print information about the joysticks */
|
||||
SDL_Log("There are %d joysticks attached\n", SDL_NumJoysticks());
|
||||
for (i = 0; i < SDL_NumJoysticks(); ++i) {
|
||||
name = SDL_JoystickNameForIndex(i);
|
||||
SDL_Log("There are %d joysticks attached\n", SDL_GetNumJoysticks());
|
||||
for (i = 0; i < SDL_GetNumJoysticks(); ++i) {
|
||||
name = SDL_GetJoystickNameForIndex(i);
|
||||
SDL_Log("Joystick %d: %s\n", i, name ? name : "Unknown Joystick");
|
||||
joystick = SDL_JoystickOpen(i);
|
||||
joystick = SDL_OpenJoystick(i);
|
||||
if (joystick == NULL) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_JoystickOpen(%d) failed: %s\n", i,
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_OpenJoystick(%d) failed: %s\n", i,
|
||||
SDL_GetError());
|
||||
} else {
|
||||
char guid[64];
|
||||
SDL_JoystickGetGUIDString(SDL_JoystickGetGUID(joystick),
|
||||
SDL_GetJoystickGUIDString(SDL_GetJoystickGUID(joystick),
|
||||
guid, sizeof(guid));
|
||||
SDL_Log(" axes: %d\n", SDL_JoystickNumAxes(joystick));
|
||||
SDL_Log(" hats: %d\n", SDL_JoystickNumHats(joystick));
|
||||
SDL_Log(" buttons: %d\n", SDL_JoystickNumButtons(joystick));
|
||||
SDL_Log("instance id: %" SDL_PRIu32 "\n", SDL_JoystickInstanceID(joystick));
|
||||
SDL_Log(" axes: %d\n", SDL_GetNumJoystickAxes(joystick));
|
||||
SDL_Log(" hats: %d\n", SDL_GetNumJoystickHats(joystick));
|
||||
SDL_Log(" buttons: %d\n", SDL_GetNumJoystickButtons(joystick));
|
||||
SDL_Log("instance id: %" SDL_PRIu32 "\n", SDL_GetJoystickInstanceID(joystick));
|
||||
SDL_Log(" guid: %s\n", guid);
|
||||
SDL_Log(" VID/PID: 0x%.4x/0x%.4x\n", SDL_JoystickGetVendor(joystick), SDL_JoystickGetProduct(joystick));
|
||||
SDL_JoystickClose(joystick);
|
||||
SDL_Log(" VID/PID: 0x%.4x/0x%.4x\n", SDL_GetJoystickVendor(joystick), SDL_GetJoystickProduct(joystick));
|
||||
SDL_CloseJoystick(joystick);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -787,12 +787,12 @@ int main(int argc, char *argv[])
|
||||
break;
|
||||
}
|
||||
}
|
||||
joystick = SDL_JoystickOpen(joystick_index);
|
||||
joystick = SDL_OpenJoystick(joystick_index);
|
||||
if (joystick == NULL) {
|
||||
SDL_Log("Couldn't open joystick %d: %s\n", joystick_index, SDL_GetError());
|
||||
} else {
|
||||
WatchJoystick(joystick);
|
||||
SDL_JoystickClose(joystick);
|
||||
SDL_CloseJoystick(joystick);
|
||||
}
|
||||
|
||||
SDL_DestroyWindow(window);
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
/**
|
||||
* @brief Check virtual joystick creation
|
||||
*
|
||||
* @sa SDL_JoystickAttachVirtualEx
|
||||
* @sa SDL_AttachVirtualJoystickEx
|
||||
*/
|
||||
static int
|
||||
TestVirtualJoystick(void *arg)
|
||||
@@ -32,36 +32,36 @@ TestVirtualJoystick(void *arg)
|
||||
desc.vendor_id = USB_VENDOR_NVIDIA;
|
||||
desc.product_id = USB_PRODUCT_NVIDIA_SHIELD_CONTROLLER_V104;
|
||||
desc.name = "Virtual NVIDIA SHIELD Controller";
|
||||
device_index = SDL_JoystickAttachVirtualEx(&desc);
|
||||
SDLTest_AssertCheck(device_index >= 0, "SDL_JoystickAttachVirtualEx()");
|
||||
SDLTest_AssertCheck(SDL_JoystickIsVirtual(device_index), "SDL_JoystickIsVirtual()");
|
||||
device_index = SDL_AttachVirtualJoystickEx(&desc);
|
||||
SDLTest_AssertCheck(device_index >= 0, "SDL_AttachVirtualJoystickEx()");
|
||||
SDLTest_AssertCheck(SDL_IsJoystickVirtual(device_index), "SDL_IsJoystickVirtual()");
|
||||
if (device_index >= 0) {
|
||||
joystick = SDL_JoystickOpen(device_index);
|
||||
SDLTest_AssertCheck(joystick != NULL, "SDL_JoystickOpen()");
|
||||
joystick = SDL_OpenJoystick(device_index);
|
||||
SDLTest_AssertCheck(joystick != NULL, "SDL_OpenJoystick()");
|
||||
if (joystick) {
|
||||
SDLTest_AssertCheck(SDL_strcmp(SDL_JoystickName(joystick), desc.name) == 0, "SDL_JoystickName()");
|
||||
SDLTest_AssertCheck(SDL_JoystickGetVendor(joystick) == desc.vendor_id, "SDL_JoystickGetVendor()");
|
||||
SDLTest_AssertCheck(SDL_JoystickGetProduct(joystick) == desc.product_id, "SDL_JoystickGetProduct()");
|
||||
SDLTest_AssertCheck(SDL_JoystickGetProductVersion(joystick) == 0, "SDL_JoystickGetProductVersion()");
|
||||
SDLTest_AssertCheck(SDL_JoystickGetFirmwareVersion(joystick) == 0, "SDL_JoystickGetFirmwareVersion()");
|
||||
SDLTest_AssertCheck(SDL_JoystickGetSerial(joystick) == NULL, "SDL_JoystickGetSerial()");
|
||||
SDLTest_AssertCheck(SDL_JoystickGetType(joystick) == desc.type, "SDL_JoystickGetType()");
|
||||
SDLTest_AssertCheck(SDL_JoystickNumAxes(joystick) == desc.naxes, "SDL_JoystickNumAxes()");
|
||||
SDLTest_AssertCheck(SDL_JoystickNumHats(joystick) == desc.nhats, "SDL_JoystickNumHats()");
|
||||
SDLTest_AssertCheck(SDL_JoystickNumButtons(joystick) == desc.nbuttons, "SDL_JoystickNumButtons()");
|
||||
SDLTest_AssertCheck(SDL_strcmp(SDL_GetJoystickName(joystick), desc.name) == 0, "SDL_GetJoystickName()");
|
||||
SDLTest_AssertCheck(SDL_GetJoystickVendor(joystick) == desc.vendor_id, "SDL_GetJoystickVendor()");
|
||||
SDLTest_AssertCheck(SDL_GetJoystickProduct(joystick) == desc.product_id, "SDL_GetJoystickProduct()");
|
||||
SDLTest_AssertCheck(SDL_GetJoystickProductVersion(joystick) == 0, "SDL_GetJoystickProductVersion()");
|
||||
SDLTest_AssertCheck(SDL_GetJoystickFirmwareVersion(joystick) == 0, "SDL_GetJoystickFirmwareVersion()");
|
||||
SDLTest_AssertCheck(SDL_GetJoystickSerial(joystick) == NULL, "SDL_GetJoystickSerial()");
|
||||
SDLTest_AssertCheck(SDL_GetJoystickType(joystick) == desc.type, "SDL_GetJoystickType()");
|
||||
SDLTest_AssertCheck(SDL_GetNumJoystickAxes(joystick) == desc.naxes, "SDL_GetNumJoystickAxes()");
|
||||
SDLTest_AssertCheck(SDL_GetNumJoystickHats(joystick) == desc.nhats, "SDL_GetNumJoystickHats()");
|
||||
SDLTest_AssertCheck(SDL_GetNumJoystickButtons(joystick) == desc.nbuttons, "SDL_GetNumJoystickButtons()");
|
||||
|
||||
SDLTest_AssertCheck(SDL_JoystickSetVirtualButton(joystick, SDL_CONTROLLER_BUTTON_A, SDL_PRESSED) == 0, "SDL_JoystickSetVirtualButton(SDL_CONTROLLER_BUTTON_A, SDL_PRESSED)");
|
||||
SDL_JoystickUpdate();
|
||||
SDLTest_AssertCheck(SDL_JoystickGetButton(joystick, SDL_CONTROLLER_BUTTON_A) == SDL_PRESSED, "SDL_JoystickGetButton(SDL_CONTROLLER_BUTTON_A) == SDL_PRESSED");
|
||||
SDLTest_AssertCheck(SDL_JoystickSetVirtualButton(joystick, SDL_CONTROLLER_BUTTON_A, SDL_RELEASED) == 0, "SDL_JoystickSetVirtualButton(SDL_CONTROLLER_BUTTON_A, SDL_RELEASED)");
|
||||
SDL_JoystickUpdate();
|
||||
SDLTest_AssertCheck(SDL_JoystickGetButton(joystick, SDL_CONTROLLER_BUTTON_A) == SDL_RELEASED, "SDL_JoystickGetButton(SDL_CONTROLLER_BUTTON_A) == SDL_RELEASED");
|
||||
SDLTest_AssertCheck(SDL_SetJoystickVirtualButton(joystick, SDL_CONTROLLER_BUTTON_A, SDL_PRESSED) == 0, "SDL_SetJoystickVirtualButton(SDL_CONTROLLER_BUTTON_A, SDL_PRESSED)");
|
||||
SDL_UpdateJoysticks();
|
||||
SDLTest_AssertCheck(SDL_GetJoystickButton(joystick, SDL_CONTROLLER_BUTTON_A) == SDL_PRESSED, "SDL_GetJoystickButton(SDL_CONTROLLER_BUTTON_A) == SDL_PRESSED");
|
||||
SDLTest_AssertCheck(SDL_SetJoystickVirtualButton(joystick, SDL_CONTROLLER_BUTTON_A, SDL_RELEASED) == 0, "SDL_SetJoystickVirtualButton(SDL_CONTROLLER_BUTTON_A, SDL_RELEASED)");
|
||||
SDL_UpdateJoysticks();
|
||||
SDLTest_AssertCheck(SDL_GetJoystickButton(joystick, SDL_CONTROLLER_BUTTON_A) == SDL_RELEASED, "SDL_GetJoystickButton(SDL_CONTROLLER_BUTTON_A) == SDL_RELEASED");
|
||||
|
||||
SDL_JoystickClose(joystick);
|
||||
SDL_CloseJoystick(joystick);
|
||||
}
|
||||
SDLTest_AssertCheck(SDL_JoystickDetachVirtual(device_index) == 0, "SDL_JoystickDetachVirtual()");
|
||||
SDLTest_AssertCheck(SDL_DetachVirtualJoystick(device_index) == 0, "SDL_DetachVirtualJoystick()");
|
||||
}
|
||||
SDLTest_AssertCheck(!SDL_JoystickIsVirtual(device_index), "!SDL_JoystickIsVirtual()");
|
||||
SDLTest_AssertCheck(!SDL_IsJoystickVirtual(device_index), "!SDL_IsJoystickVirtual()");
|
||||
|
||||
SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER);
|
||||
|
||||
|
||||
+25
-25
@@ -158,7 +158,7 @@ static int FindController(SDL_JoystickID controller_id)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < num_controllers; ++i) {
|
||||
if (controller_id == SDL_JoystickInstanceID(SDL_GameControllerGetJoystick(gamecontrollers[i]))) {
|
||||
if (controller_id == SDL_GetJoystickInstanceID(SDL_GameControllerGetJoystick(gamecontrollers[i]))) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
@@ -167,7 +167,7 @@ static int FindController(SDL_JoystickID controller_id)
|
||||
|
||||
static void AddController(int device_index, SDL_bool verbose)
|
||||
{
|
||||
SDL_JoystickID controller_id = SDL_JoystickGetDeviceInstanceID(device_index);
|
||||
SDL_JoystickID controller_id = SDL_GetJoystickDeviceInstanceID(device_index);
|
||||
SDL_GameController *controller;
|
||||
SDL_GameController **controllers;
|
||||
Uint16 firmware_version;
|
||||
@@ -181,7 +181,7 @@ static void AddController(int device_index, SDL_bool verbose)
|
||||
};
|
||||
unsigned int i;
|
||||
|
||||
controller_id = SDL_JoystickGetDeviceInstanceID(device_index);
|
||||
controller_id = SDL_GetJoystickDeviceInstanceID(device_index);
|
||||
if (controller_id < 0) {
|
||||
SDL_Log("Couldn't get controller ID: %s\n", SDL_GetError());
|
||||
return;
|
||||
@@ -400,11 +400,11 @@ static void OpenVirtualController()
|
||||
desc.RumbleTriggers = VirtualControllerRumbleTriggers;
|
||||
desc.SetLED = VirtualControllerSetLED;
|
||||
|
||||
virtual_index = SDL_JoystickAttachVirtualEx(&desc);
|
||||
virtual_index = SDL_AttachVirtualJoystickEx(&desc);
|
||||
if (virtual_index < 0) {
|
||||
SDL_Log("Couldn't open virtual device: %s\n", SDL_GetError());
|
||||
} else {
|
||||
virtual_joystick = SDL_JoystickOpen(virtual_index);
|
||||
virtual_joystick = SDL_OpenJoystick(virtual_index);
|
||||
if (virtual_joystick == NULL) {
|
||||
SDL_Log("Couldn't open virtual device: %s\n", SDL_GetError());
|
||||
}
|
||||
@@ -415,14 +415,14 @@ static void CloseVirtualController()
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = SDL_NumJoysticks(); i--;) {
|
||||
if (SDL_JoystickIsVirtual(i)) {
|
||||
SDL_JoystickDetachVirtual(i);
|
||||
for (i = SDL_GetNumJoysticks(); i--;) {
|
||||
if (SDL_IsJoystickVirtual(i)) {
|
||||
SDL_DetachVirtualJoystick(i);
|
||||
}
|
||||
}
|
||||
|
||||
if (virtual_joystick) {
|
||||
SDL_JoystickClose(virtual_joystick);
|
||||
SDL_CloseJoystick(virtual_joystick);
|
||||
virtual_joystick = NULL;
|
||||
}
|
||||
}
|
||||
@@ -481,7 +481,7 @@ static void VirtualControllerMouseMotion(int x, int y)
|
||||
const int MOVING_DISTANCE = 2;
|
||||
if (SDL_abs(x - virtual_axis_start_x) >= MOVING_DISTANCE ||
|
||||
SDL_abs(y - virtual_axis_start_y) >= MOVING_DISTANCE) {
|
||||
SDL_JoystickSetVirtualButton(virtual_joystick, virtual_button_active, SDL_RELEASED);
|
||||
SDL_SetJoystickVirtualButton(virtual_joystick, virtual_button_active, SDL_RELEASED);
|
||||
virtual_button_active = SDL_CONTROLLER_BUTTON_INVALID;
|
||||
}
|
||||
}
|
||||
@@ -493,7 +493,7 @@ static void VirtualControllerMouseMotion(int x, int y)
|
||||
int range = (SDL_JOYSTICK_AXIS_MAX - SDL_JOYSTICK_AXIS_MIN);
|
||||
float distance = SDL_clamp(((float)y - virtual_axis_start_y) / AXIS_SIZE, 0.0f, 1.0f);
|
||||
Sint16 value = (Sint16)(SDL_JOYSTICK_AXIS_MIN + (distance * range));
|
||||
SDL_JoystickSetVirtualAxis(virtual_joystick, virtual_axis_active, value);
|
||||
SDL_SetJoystickVirtualAxis(virtual_joystick, virtual_axis_active, value);
|
||||
} else {
|
||||
float distanceX = SDL_clamp(((float)x - virtual_axis_start_x) / AXIS_SIZE, -1.0f, 1.0f);
|
||||
float distanceY = SDL_clamp(((float)y - virtual_axis_start_y) / AXIS_SIZE, -1.0f, 1.0f);
|
||||
@@ -509,8 +509,8 @@ static void VirtualControllerMouseMotion(int x, int y)
|
||||
} else {
|
||||
valueY = (Sint16)(distanceY * -SDL_JOYSTICK_AXIS_MIN);
|
||||
}
|
||||
SDL_JoystickSetVirtualAxis(virtual_joystick, virtual_axis_active, valueX);
|
||||
SDL_JoystickSetVirtualAxis(virtual_joystick, virtual_axis_active + 1, valueY);
|
||||
SDL_SetJoystickVirtualAxis(virtual_joystick, virtual_axis_active, valueX);
|
||||
SDL_SetJoystickVirtualAxis(virtual_joystick, virtual_axis_active + 1, valueY);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -523,7 +523,7 @@ static void VirtualControllerMouseDown(int x, int y)
|
||||
button = FindButtonAtPosition(x, y);
|
||||
if (button != SDL_CONTROLLER_BUTTON_INVALID) {
|
||||
virtual_button_active = button;
|
||||
SDL_JoystickSetVirtualButton(virtual_joystick, virtual_button_active, SDL_PRESSED);
|
||||
SDL_SetJoystickVirtualButton(virtual_joystick, virtual_button_active, SDL_PRESSED);
|
||||
}
|
||||
|
||||
axis = FindAxisAtPosition(x, y);
|
||||
@@ -537,17 +537,17 @@ static void VirtualControllerMouseDown(int x, int y)
|
||||
static void VirtualControllerMouseUp(int x, int y)
|
||||
{
|
||||
if (virtual_button_active != SDL_CONTROLLER_BUTTON_INVALID) {
|
||||
SDL_JoystickSetVirtualButton(virtual_joystick, virtual_button_active, SDL_RELEASED);
|
||||
SDL_SetJoystickVirtualButton(virtual_joystick, virtual_button_active, SDL_RELEASED);
|
||||
virtual_button_active = SDL_CONTROLLER_BUTTON_INVALID;
|
||||
}
|
||||
|
||||
if (virtual_axis_active != SDL_CONTROLLER_AXIS_INVALID) {
|
||||
if (virtual_axis_active == SDL_CONTROLLER_AXIS_TRIGGERLEFT ||
|
||||
virtual_axis_active == SDL_CONTROLLER_AXIS_TRIGGERRIGHT) {
|
||||
SDL_JoystickSetVirtualAxis(virtual_joystick, virtual_axis_active, SDL_JOYSTICK_AXIS_MIN);
|
||||
SDL_SetJoystickVirtualAxis(virtual_joystick, virtual_axis_active, SDL_JOYSTICK_AXIS_MIN);
|
||||
} else {
|
||||
SDL_JoystickSetVirtualAxis(virtual_joystick, virtual_axis_active, 0);
|
||||
SDL_JoystickSetVirtualAxis(virtual_joystick, virtual_axis_active + 1, 0);
|
||||
SDL_SetJoystickVirtualAxis(virtual_joystick, virtual_axis_active, 0);
|
||||
SDL_SetJoystickVirtualAxis(virtual_joystick, virtual_axis_active + 1, 0);
|
||||
}
|
||||
virtual_axis_active = SDL_CONTROLLER_AXIS_INVALID;
|
||||
}
|
||||
@@ -566,7 +566,7 @@ void loop(void *arg)
|
||||
while (SDL_PeepEvents(&event, 1, SDL_GETEVENT, SDL_FIRSTEVENT, SDL_LASTEVENT) == 1) {
|
||||
switch (event.type) {
|
||||
case SDL_CONTROLLERDEVICEADDED:
|
||||
SDL_Log("Game controller device %d added.\n", (int)SDL_JoystickGetDeviceInstanceID(event.cdevice.which));
|
||||
SDL_Log("Game controller device %d added.\n", (int)SDL_GetJoystickDeviceInstanceID(event.cdevice.which));
|
||||
AddController(event.cdevice.which, SDL_TRUE);
|
||||
break;
|
||||
|
||||
@@ -823,12 +823,12 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
/* Print information about the controller */
|
||||
for (i = 0; i < SDL_NumJoysticks(); ++i) {
|
||||
for (i = 0; i < SDL_GetNumJoysticks(); ++i) {
|
||||
const char *name;
|
||||
const char *path;
|
||||
const char *description;
|
||||
|
||||
SDL_JoystickGetGUIDString(SDL_JoystickGetDeviceGUID(i),
|
||||
SDL_GetJoystickGUIDString(SDL_GetJoystickDeviceGUID(i),
|
||||
guid, sizeof(guid));
|
||||
|
||||
if (SDL_IsGameController(i)) {
|
||||
@@ -874,15 +874,15 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
AddController(i, SDL_FALSE);
|
||||
} else {
|
||||
name = SDL_JoystickNameForIndex(i);
|
||||
path = SDL_JoystickPathForIndex(i);
|
||||
name = SDL_GetJoystickNameForIndex(i);
|
||||
path = SDL_GetJoystickPathForIndex(i);
|
||||
description = "Joystick";
|
||||
}
|
||||
SDL_Log("%s %d: %s%s%s (guid %s, VID 0x%.4x, PID 0x%.4x, player index = %d)\n",
|
||||
description, i, name ? name : "Unknown", path ? ", " : "", path ? path : "", guid,
|
||||
SDL_JoystickGetDeviceVendor(i), SDL_JoystickGetDeviceProduct(i), SDL_JoystickGetDevicePlayerIndex(i));
|
||||
SDL_GetJoystickDeviceVendor(i), SDL_GetJoystickDeviceProduct(i), SDL_GetJoystickDevicePlayerIndex(i));
|
||||
}
|
||||
SDL_Log("There are %d game controller(s) attached (%d joystick(s))\n", controller_count, SDL_NumJoysticks());
|
||||
SDL_Log("There are %d game controller(s) attached (%d joystick(s))\n", controller_count, SDL_GetNumJoysticks());
|
||||
|
||||
/* Create a window to display controller state */
|
||||
window = SDL_CreateWindow("Game Controller Test", SDL_WINDOWPOS_CENTERED,
|
||||
|
||||
+5
-5
@@ -52,7 +52,7 @@ int main(int argc, char *argv[])
|
||||
//SDL_CreateWindow("Dummy", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 128, 128, 0);
|
||||
*/
|
||||
|
||||
SDL_Log("There are %d joysticks at startup\n", SDL_NumJoysticks());
|
||||
SDL_Log("There are %d joysticks at startup\n", SDL_GetNumJoysticks());
|
||||
if (enable_haptic) {
|
||||
SDL_Log("There are %d haptic devices at startup\n", SDL_NumHaptics());
|
||||
}
|
||||
@@ -68,9 +68,9 @@ int main(int argc, char *argv[])
|
||||
if (joystick != NULL) {
|
||||
SDL_Log("Only one joystick supported by this test\n");
|
||||
} else {
|
||||
joystick = SDL_JoystickOpen(event.jdevice.which);
|
||||
instance = SDL_JoystickInstanceID(joystick);
|
||||
SDL_Log("Joy Added : %" SDL_PRIs32 " : %s\n", event.jdevice.which, SDL_JoystickName(joystick));
|
||||
joystick = SDL_OpenJoystick(event.jdevice.which);
|
||||
instance = SDL_GetJoystickInstanceID(joystick);
|
||||
SDL_Log("Joy Added : %" SDL_PRIs32 " : %s\n", event.jdevice.which, SDL_GetJoystickName(joystick));
|
||||
if (enable_haptic) {
|
||||
if (SDL_JoystickIsHaptic(joystick)) {
|
||||
haptic = SDL_HapticOpenFromJoystick(joystick);
|
||||
@@ -98,7 +98,7 @@ int main(int argc, char *argv[])
|
||||
SDL_HapticClose(haptic);
|
||||
haptic = NULL;
|
||||
}
|
||||
SDL_JoystickClose(joystick);
|
||||
SDL_CloseJoystick(joystick);
|
||||
joystick = NULL;
|
||||
} else {
|
||||
SDL_Log("Unknown joystick diconnected\n");
|
||||
|
||||
+23
-23
@@ -40,9 +40,9 @@ PrintJoystick(SDL_Joystick *joy)
|
||||
const char *type;
|
||||
char guid[64];
|
||||
|
||||
SDL_assert(SDL_JoystickFromInstanceID(SDL_JoystickInstanceID(joy)) == joy);
|
||||
SDL_JoystickGetGUIDString(SDL_JoystickGetGUID(joy), guid, sizeof(guid));
|
||||
switch (SDL_JoystickGetType(joy)) {
|
||||
SDL_assert(SDL_GetJoystickFromInstanceID(SDL_GetJoystickInstanceID(joy)) == joy);
|
||||
SDL_GetJoystickGUIDString(SDL_GetJoystickGUID(joy), guid, sizeof(guid));
|
||||
switch (SDL_GetJoystickType(joy)) {
|
||||
case SDL_JOYSTICK_TYPE_GAMECONTROLLER:
|
||||
type = "Game Controller";
|
||||
break;
|
||||
@@ -75,17 +75,17 @@ PrintJoystick(SDL_Joystick *joy)
|
||||
break;
|
||||
}
|
||||
SDL_Log("Joystick\n");
|
||||
SDL_Log(" name: %s\n", SDL_JoystickName(joy));
|
||||
SDL_Log(" name: %s\n", SDL_GetJoystickName(joy));
|
||||
SDL_Log(" type: %s\n", type);
|
||||
SDL_Log(" LED: %s\n", SDL_JoystickHasLED(joy) ? "yes" : "no");
|
||||
SDL_Log(" rumble: %s\n", SDL_JoystickHasRumble(joy) ? "yes" : "no");
|
||||
SDL_Log("trigger rumble: %s\n", SDL_JoystickHasRumbleTriggers(joy) ? "yes" : "no");
|
||||
SDL_Log(" axes: %d\n", SDL_JoystickNumAxes(joy));
|
||||
SDL_Log(" hats: %d\n", SDL_JoystickNumHats(joy));
|
||||
SDL_Log(" buttons: %d\n", SDL_JoystickNumButtons(joy));
|
||||
SDL_Log(" instance id: %" SDL_PRIs32 "\n", SDL_JoystickInstanceID(joy));
|
||||
SDL_Log(" axes: %d\n", SDL_GetNumJoystickAxes(joy));
|
||||
SDL_Log(" hats: %d\n", SDL_GetNumJoystickHats(joy));
|
||||
SDL_Log(" buttons: %d\n", SDL_GetNumJoystickButtons(joy));
|
||||
SDL_Log(" instance id: %" SDL_PRIs32 "\n", SDL_GetJoystickInstanceID(joy));
|
||||
SDL_Log(" guid: %s\n", guid);
|
||||
SDL_Log(" VID/PID: 0x%.4x/0x%.4x\n", SDL_JoystickGetVendor(joy), SDL_JoystickGetProduct(joy));
|
||||
SDL_Log(" VID/PID: 0x%.4x/0x%.4x\n", SDL_GetJoystickVendor(joy), SDL_GetJoystickProduct(joy));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -114,7 +114,7 @@ void loop(void *arg)
|
||||
case SDL_JOYDEVICEADDED:
|
||||
SDL_Log("Joystick device %d added.\n", (int)event.jdevice.which);
|
||||
if (joystick == NULL) {
|
||||
joystick = SDL_JoystickOpen(event.jdevice.which);
|
||||
joystick = SDL_OpenJoystick(event.jdevice.which);
|
||||
if (joystick) {
|
||||
PrintJoystick(joystick);
|
||||
} else {
|
||||
@@ -125,9 +125,9 @@ void loop(void *arg)
|
||||
|
||||
case SDL_JOYDEVICEREMOVED:
|
||||
SDL_Log("Joystick device %d removed.\n", (int)event.jdevice.which);
|
||||
if (event.jdevice.which == SDL_JoystickInstanceID(joystick)) {
|
||||
SDL_JoystickClose(joystick);
|
||||
joystick = SDL_JoystickOpen(0);
|
||||
if (event.jdevice.which == SDL_GetJoystickInstanceID(joystick)) {
|
||||
SDL_CloseJoystick(joystick);
|
||||
joystick = SDL_OpenJoystick(0);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -161,7 +161,7 @@ void loop(void *arg)
|
||||
event.jbutton.which, event.jbutton.button);
|
||||
/* First button triggers a 0.5 second full strength rumble */
|
||||
if (event.jbutton.button == 0) {
|
||||
SDL_JoystickRumble(joystick, 0xFFFF, 0xFFFF, 500);
|
||||
SDL_RumbleJoystick(joystick, 0xFFFF, 0xFFFF, 500);
|
||||
}
|
||||
break;
|
||||
case SDL_JOYBUTTONUP:
|
||||
@@ -198,21 +198,21 @@ void loop(void *arg)
|
||||
|
||||
/* Update visual joystick state */
|
||||
SDL_SetRenderDrawColor(screen, 0x00, 0xFF, 0x00, SDL_ALPHA_OPAQUE);
|
||||
y = SCREEN_HEIGHT - ((((SDL_JoystickNumButtons(joystick) + (BUTTONS_PER_LINE - 1)) / BUTTONS_PER_LINE) + 1) * 34);
|
||||
for (i = 0; i < SDL_JoystickNumButtons(joystick); ++i) {
|
||||
y = SCREEN_HEIGHT - ((((SDL_GetNumJoystickButtons(joystick) + (BUTTONS_PER_LINE - 1)) / BUTTONS_PER_LINE) + 1) * 34);
|
||||
for (i = 0; i < SDL_GetNumJoystickButtons(joystick); ++i) {
|
||||
if ((i % BUTTONS_PER_LINE) == 0) {
|
||||
y += 34;
|
||||
}
|
||||
if (SDL_JoystickGetButton(joystick, i) == SDL_PRESSED) {
|
||||
if (SDL_GetJoystickButton(joystick, i) == SDL_PRESSED) {
|
||||
x = 2 + (i % BUTTONS_PER_LINE) * 34;
|
||||
DrawRect(screen, x, y, 32, 32);
|
||||
}
|
||||
}
|
||||
|
||||
SDL_SetRenderDrawColor(screen, 0xFF, 0x00, 0x00, SDL_ALPHA_OPAQUE);
|
||||
for (i = 0; i < SDL_JoystickNumAxes(joystick); ++i) {
|
||||
for (i = 0; i < SDL_GetNumJoystickAxes(joystick); ++i) {
|
||||
/* Draw the X/Y axis */
|
||||
x = (((int)SDL_JoystickGetAxis(joystick, i)) + 32768);
|
||||
x = (((int)SDL_GetJoystickAxis(joystick, i)) + 32768);
|
||||
x *= SCREEN_WIDTH;
|
||||
x /= 65535;
|
||||
if (x < 0) {
|
||||
@@ -221,8 +221,8 @@ void loop(void *arg)
|
||||
x = SCREEN_WIDTH - 16;
|
||||
}
|
||||
++i;
|
||||
if (i < SDL_JoystickNumAxes(joystick)) {
|
||||
y = (((int)SDL_JoystickGetAxis(joystick, i)) + 32768);
|
||||
if (i < SDL_GetNumJoystickAxes(joystick)) {
|
||||
y = (((int)SDL_GetJoystickAxis(joystick, i)) + 32768);
|
||||
} else {
|
||||
y = 32768;
|
||||
}
|
||||
@@ -238,9 +238,9 @@ void loop(void *arg)
|
||||
}
|
||||
|
||||
SDL_SetRenderDrawColor(screen, 0x00, 0x00, 0xFF, SDL_ALPHA_OPAQUE);
|
||||
for (i = 0; i < SDL_JoystickNumHats(joystick); ++i) {
|
||||
for (i = 0; i < SDL_GetNumJoystickHats(joystick); ++i) {
|
||||
/* Derive the new position */
|
||||
const Uint8 hat_pos = SDL_JoystickGetHat(joystick, i);
|
||||
const Uint8 hat_pos = SDL_GetJoystickHat(joystick, i);
|
||||
x = SCREEN_WIDTH / 2;
|
||||
y = SCREEN_HEIGHT / 2;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user