SDL API renaming: SDL_joystick.h

Fixes https://github.com/libsdl-org/SDL/issues/6881
main
Sam Lantinga 2022-12-27 05:50:46 -08:00
parent aa0053141b
commit fc478c1bc0
38 changed files with 751 additions and 543 deletions

View File

@ -23,7 +23,57 @@ General:
* SDL_AudioStreamGet => SDL_GetAudioStreamData * SDL_AudioStreamGet => SDL_GetAudioStreamData
* SDL_AudioStreamPut => SDL_PutAudioStreamData * SDL_AudioStreamPut => SDL_PutAudioStreamData
* SDL_FreeAudioStream => SDL_DestroyAudioStream * 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_NewAudioStream => SDL_CreateAudioStream
* SDL_NumJoysticks => SDL_GetNumJoysticks
* Removed the following functions from the API, see docs/README-migration.md for details: * Removed the following functions from the API, see docs/README-migration.md for details:
* SDL_AudioInit() * SDL_AudioInit()
* SDL_AudioQuit() * SDL_AudioQuit()

View File

@ -18,7 +18,7 @@ Happy (happy.c):
Accelerometer (accelerometer.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): Touch (touch.c):

View File

@ -37,8 +37,8 @@ render(SDL_Renderer *renderer, int w, int h, double deltaTime)
float speed; float speed;
/* get joystick (accelerometer) axis values and normalize them */ /* get joystick (accelerometer) axis values and normalize them */
float ax = SDL_JoystickGetAxis(accelerometer, 0); float ax = SDL_GetJoystickAxis(accelerometer, 0);
float ay = SDL_JoystickGetAxis(accelerometer, 1); float ay = SDL_GetJoystickAxis(accelerometer, 1);
/* ship screen constraints */ /* ship screen constraints */
Uint32 minx = 0.0f; Uint32 minx = 0.0f;
@ -177,18 +177,18 @@ main(int argc, char *argv[])
SDL_RenderSetLogicalSize(renderer, w, h); SDL_RenderSetLogicalSize(renderer, w, h);
/* print out some info about joysticks and try to open accelerometer for use */ /* print out some info about joysticks and try to open accelerometer for use */
printf("There are %d joysticks available\n", SDL_NumJoysticks()); printf("There are %d joysticks available\n", SDL_GetNumJoysticks());
printf("Default joystick (index 0) is %s\n", SDL_JoystickName(0)); printf("Default joystick (index 0) is %s\n", SDL_GetJoystickName(0));
accelerometer = SDL_JoystickOpen(0); accelerometer = SDL_OpenJoystick(0);
if (accelerometer == NULL) { if (accelerometer == NULL) {
fatalError("Could not open joystick (accelerometer)"); fatalError("Could not open joystick (accelerometer)");
} }
printf("joystick number of axis = %d\n", printf("joystick number of axis = %d\n",
SDL_JoystickNumAxes(accelerometer)); SDL_GetNumJoystickAxes(accelerometer));
printf("joystick number of hats = %d\n", printf("joystick number of hats = %d\n",
SDL_JoystickNumHats(accelerometer)); SDL_GetNumJoystickHats(accelerometer));
printf("joystick number of buttons = %d\n", printf("joystick number of buttons = %d\n",
SDL_JoystickNumButtons(accelerometer)); SDL_GetNumJoystickButtons(accelerometer));
/* load graphics */ /* load graphics */
initializeTextures(renderer); initializeTextures(renderer);

View File

@ -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. 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 Notes -- OpenGL ES

View File

@ -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 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' * 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 ## SDL_keycode.h
The following enums have been renamed: The following enums have been renamed:

View File

@ -107,7 +107,7 @@ typedef struct SDL_GameControllerButtonBind
* To count the number of game controllers in the system for the following: * To count the number of game controllers in the system for the following:
* *
* ```c * ```c
* int nJoysticks = SDL_NumJoysticks(); * int nJoysticks = SDL_GetNumJoysticks();
* int nGameControllers = 0; * int nGameControllers = 0;
* for (int i = 0; i < nJoysticks; i++) { * for (int i = 0; i < nJoysticks; i++) {
* if (SDL_IsGameController(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: * 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 * 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. * Under Windows there is a reserved GUID of "xinput" that covers any XInput devices.
* The mapping format for joystick is: * The mapping format for joystick is:
* bX - a joystick button, index X * 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. * controller to have a different binding.
* *
* The mapping string has the format "GUID,name,mapping", where GUID is the * 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 * string for the device and mappings are controller mappings to joystick
* ones. Under Windows there is a reserved GUID of "xinput" that covers all * ones. Under Windows there is a reserved GUID of "xinput" that covers all
* XInput devices. The mapping format for joystick is: {| |bX |a joystick * 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. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_JoystickGetDeviceGUID * \sa SDL_GetJoystickDeviceGUID
* \sa SDL_JoystickGetGUID * \sa SDL_GetJoystickGUID
*/ */
extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForGUID(SDL_JoystickGUID guid); 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. * Check if the given joystick is supported by the game controller interface.
* *
* `joystick_index` is the same as the `device_index` passed to * `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 * \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 * \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. * 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. * This function can be called before any controllers are opened.
* *
* `joystick_index` is the same as the `device_index` passed to * `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 * \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 * \returns the implementation-dependent name for the game controller, or NULL
* if there is no name or the index is invalid. * 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. * This function can be called before any controllers are opened.
* *
* `joystick_index` is the same as the `device_index` passed to * `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 * \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 * \returns the implementation-dependent path for the game controller, or NULL
* if there is no path or the index is invalid. * 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. * This can be called before any controllers are opened.
* *
* \param joystick_index the device_index of a device, from zero to * \param joystick_index the device_index of a device, from zero to
* SDL_NumJoysticks()-1 * SDL_GetNumJoysticks()-1
* \returns the controller type. * \returns the controller type.
* *
* \since This function is available since SDL 3.0.0. * \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. * This can be called before any controllers are opened.
* *
* \param joystick_index the device_index of a device, from zero to * \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 * \returns the mapping string. Must be freed with SDL_free(). Returns NULL if
* no mapping is available. * no mapping is available.
* *
@ -343,7 +343,7 @@ extern DECLSPEC char *SDLCALL SDL_GameControllerMappingForDeviceIndex(int joysti
* Open a game controller for use. * Open a game controller for use.
* *
* `joystick_index` is the same as the `device_index` passed to * `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 * 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 * 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. * be used there instead.
* *
* \param joystick_index the device_index of a device, up to * \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 * \returns a gamecontroller identifier or NULL if an error occurred; call
* SDL_GetError() for more information. * SDL_GetError() for more information.
* *
@ -548,7 +548,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerGetAttached(SDL_GameControlle
* value). * value).
* *
* The pointer returned is owned by the SDL_GameController. You should not * 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. * cause SDL to crash.
* *
* \param gamecontroller the game controller object that you want to get a * \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. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_JoystickEventState * \sa SDL_GetJoystickEventState
*/ */
extern DECLSPEC int SDLCALL SDL_GameControllerEventState(int state); extern DECLSPEC int SDLCALL SDL_GameControllerEventState(int state);

View File

@ -296,8 +296,8 @@ extern "C" {
* *
* This variable can be set to the following values: * This variable can be set to the following values:
* *
* "0" - You'll call SDL_JoystickUpdate() manually * "0" - You'll call SDL_UpdateJoysticks() manually
* "1" - SDL will automatically call SDL_JoystickUpdate() (default) * "1" - SDL will automatically call SDL_UpdateJoysticks() (default)
* *
* This hint can be toggled on and off at runtime. * This hint can be toggled on and off at runtime.
*/ */

View File

@ -24,7 +24,7 @@
* *
* Include file for SDL joystick event handling * Include file for SDL joystick event handling
* *
* The term "device_index" identifies currently plugged in joystick devices between 0 and SDL_NumJoysticks(), with the exact joystick * The term "device_index" identifies currently plugged in joystick devices between 0 and SDL_GetNumJoysticks(), with the exact joystick
* behind a device_index changing as joysticks are plugged and unplugged. * behind a device_index changing as joysticks are plugged and unplugged.
* *
* The term "instance_id" is the current instantiation of a joystick device in the system, if the joystick is removed and then re-inserted * The term "instance_id" is the current instantiation of a joystick device in the system, if the joystick is removed and then re-inserted
@ -160,11 +160,11 @@ extern DECLSPEC void SDLCALL SDL_UnlockJoysticks(void) SDL_RELEASE(SDL_joystick_
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_JoystickName * \sa SDL_GetJoystickName
* \sa SDL_JoystickPath * \sa SDL_GetJoystickPath
* \sa SDL_JoystickOpen * \sa SDL_OpenJoystick
*/ */
extern DECLSPEC int SDLCALL SDL_NumJoysticks(void); extern DECLSPEC int SDLCALL SDL_GetNumJoysticks(void);
/** /**
* Get the implementation dependent name of a joystick. * Get the implementation dependent name of a joystick.
@ -178,10 +178,10 @@ extern DECLSPEC int SDLCALL SDL_NumJoysticks(void);
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_JoystickName * \sa SDL_GetJoystickName
* \sa SDL_JoystickOpen * \sa SDL_OpenJoystick
*/ */
extern DECLSPEC const char *SDLCALL SDL_JoystickNameForIndex(int device_index); extern DECLSPEC const char *SDLCALL SDL_GetJoystickNameForIndex(int device_index);
/** /**
* Get the implementation dependent path of a joystick. * Get the implementation dependent path of a joystick.
@ -195,10 +195,10 @@ extern DECLSPEC const char *SDLCALL SDL_JoystickNameForIndex(int device_index);
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_JoystickPath * \sa SDL_GetJoystickPath
* \sa SDL_JoystickOpen * \sa SDL_OpenJoystick
*/ */
extern DECLSPEC const char *SDLCALL SDL_JoystickPathForIndex(int device_index); extern DECLSPEC const char *SDLCALL SDL_GetJoystickPathForIndex(int device_index);
/** /**
* Get the player index of a joystick, or -1 if it's not available This can be * Get the player index of a joystick, or -1 if it's not available This can be
@ -206,7 +206,7 @@ extern DECLSPEC const char *SDLCALL SDL_JoystickPathForIndex(int device_index);
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
*/ */
extern DECLSPEC int SDLCALL SDL_JoystickGetDevicePlayerIndex(int device_index); extern DECLSPEC int SDLCALL SDL_GetJoystickDevicePlayerIndex(int device_index);
/** /**
* Get the implementation-dependent GUID for the joystick at a given device * Get the implementation-dependent GUID for the joystick at a given device
@ -221,10 +221,10 @@ extern DECLSPEC int SDLCALL SDL_JoystickGetDevicePlayerIndex(int device_index);
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_JoystickGetGUID * \sa SDL_GetJoystickGUID
* \sa SDL_JoystickGetGUIDString * \sa SDL_GetJoystickGUIDString
*/ */
extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetDeviceGUID(int device_index); extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetJoystickDeviceGUID(int device_index);
/** /**
* Get the USB vendor ID of a joystick, if available. * Get the USB vendor ID of a joystick, if available.
@ -239,7 +239,7 @@ extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetDeviceGUID(int device_in
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
*/ */
extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceVendor(int device_index); extern DECLSPEC Uint16 SDLCALL SDL_GetJoystickDeviceVendor(int device_index);
/** /**
* Get the USB product ID of a joystick, if available. * Get the USB product ID of a joystick, if available.
@ -254,7 +254,7 @@ extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceVendor(int device_index);
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
*/ */
extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceProduct(int device_index); extern DECLSPEC Uint16 SDLCALL SDL_GetJoystickDeviceProduct(int device_index);
/** /**
* Get the product version of a joystick, if available. * Get the product version of a joystick, if available.
@ -269,7 +269,7 @@ extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceProduct(int device_index);
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
*/ */
extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceProductVersion(int device_index); extern DECLSPEC Uint16 SDLCALL SDL_GetJoystickDeviceProductVersion(int device_index);
/** /**
* Get the type of a joystick, if available. * Get the type of a joystick, if available.
@ -283,7 +283,7 @@ extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceProductVersion(int device_in
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
*/ */
extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetDeviceType(int device_index); extern DECLSPEC SDL_JoystickType SDLCALL SDL_GetJoystickDeviceType(int device_index);
/** /**
* Get the instance ID of a joystick. * Get the instance ID of a joystick.
@ -298,7 +298,7 @@ extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetDeviceType(int device_in
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
*/ */
extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickGetDeviceInstanceID(int device_index); extern DECLSPEC SDL_JoystickID SDLCALL SDL_GetJoystickDeviceInstanceID(int device_index);
/** /**
* Open a joystick for use. * Open a joystick for use.
@ -306,7 +306,7 @@ extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickGetDeviceInstanceID(int devic
* The `device_index` argument refers to the N'th joystick presently * The `device_index` argument refers to the N'th joystick presently
* recognized by SDL on the system. It is **NOT** the same as the instance ID * recognized by SDL on the system. It is **NOT** the same as the instance ID
* used to identify the joystick in future events. See * used to identify the joystick in future events. See
* SDL_JoystickInstanceID() for more details about instance IDs. * SDL_GetJoystickInstanceID() for more details about instance IDs.
* *
* The joystick subsystem must be initialized before a joystick can be opened * The joystick subsystem must be initialized before a joystick can be opened
* for use. * for use.
@ -317,10 +317,10 @@ extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickGetDeviceInstanceID(int devic
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_JoystickClose * \sa SDL_CloseJoystick
* \sa SDL_JoystickInstanceID * \sa SDL_GetJoystickInstanceID
*/ */
extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickOpen(int device_index); extern DECLSPEC SDL_Joystick *SDLCALL SDL_OpenJoystick(int device_index);
/** /**
* Get the SDL_Joystick associated with an instance id. * Get the SDL_Joystick associated with an instance id.
@ -331,7 +331,7 @@ extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickOpen(int device_index);
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
*/ */
extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromInstanceID(SDL_JoystickID instance_id); extern DECLSPEC SDL_Joystick *SDLCALL SDL_GetJoystickFromInstanceID(SDL_JoystickID instance_id);
/** /**
* Get the SDL_Joystick associated with a player index. * Get the SDL_Joystick associated with a player index.
@ -342,7 +342,7 @@ extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromInstanceID(SDL_JoystickID
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
*/ */
extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromPlayerIndex(int player_index); extern DECLSPEC SDL_Joystick *SDLCALL SDL_GetJoystickFromPlayerIndex(int player_index);
/** /**
* Attach a new virtual joystick. * Attach a new virtual joystick.
@ -351,7 +351,7 @@ extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromPlayerIndex(int player_ind
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
*/ */
extern DECLSPEC int SDLCALL SDL_JoystickAttachVirtual(SDL_JoystickType type, extern DECLSPEC int SDLCALL SDL_AttachVirtualJoystick(SDL_JoystickType type,
int naxes, int naxes,
int nbuttons, int nbuttons,
int nhats); int nhats);
@ -359,10 +359,10 @@ extern DECLSPEC int SDLCALL SDL_JoystickAttachVirtual(SDL_JoystickType type,
/** /**
* The structure that defines an extended virtual joystick description * The structure that defines an extended virtual joystick description
* *
* The caller must zero the structure and then initialize the version with `SDL_VIRTUAL_JOYSTICK_DESC_VERSION` before passing it to SDL_JoystickAttachVirtualEx() * The caller must zero the structure and then initialize the version with `SDL_VIRTUAL_JOYSTICK_DESC_VERSION` before passing it to SDL_AttachVirtualJoystickEx()
* All other elements of this structure are optional and can be left 0. * All other elements of this structure are optional and can be left 0.
* *
* \sa SDL_JoystickAttachVirtualEx * \sa SDL_AttachVirtualJoystickEx
*/ */
typedef struct SDL_VirtualJoystickDesc typedef struct SDL_VirtualJoystickDesc
{ {
@ -383,10 +383,10 @@ typedef struct SDL_VirtualJoystickDesc
void *userdata; /**< User data pointer passed to callbacks */ void *userdata; /**< User data pointer passed to callbacks */
void (SDLCALL *Update)(void *userdata); /**< Called when the joystick state should be updated */ void (SDLCALL *Update)(void *userdata); /**< Called when the joystick state should be updated */
void (SDLCALL *SetPlayerIndex)(void *userdata, int player_index); /**< Called when the player index is set */ void (SDLCALL *SetPlayerIndex)(void *userdata, int player_index); /**< Called when the player index is set */
int (SDLCALL *Rumble)(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble); /**< Implements SDL_JoystickRumble() */ int (SDLCALL *Rumble)(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble); /**< Implements SDL_RumbleJoystick() */
int (SDLCALL *RumbleTriggers)(void *userdata, Uint16 left_rumble, Uint16 right_rumble); /**< Implements SDL_JoystickRumbleTriggers() */ int (SDLCALL *RumbleTriggers)(void *userdata, Uint16 left_rumble, Uint16 right_rumble); /**< Implements SDL_RumbleJoystickTriggers() */
int (SDLCALL *SetLED)(void *userdata, Uint8 red, Uint8 green, Uint8 blue); /**< Implements SDL_JoystickSetLED() */ int (SDLCALL *SetLED)(void *userdata, Uint8 red, Uint8 green, Uint8 blue); /**< Implements SDL_SetJoystickLED() */
int (SDLCALL *SendEffect)(void *userdata, const void *data, int size); /**< Implements SDL_JoystickSendEffect() */ int (SDLCALL *SendEffect)(void *userdata, const void *data, int size); /**< Implements SDL_SendJoystickEffect() */
} SDL_VirtualJoystickDesc; } SDL_VirtualJoystickDesc;
@ -402,18 +402,18 @@ typedef struct SDL_VirtualJoystickDesc
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
*/ */
extern DECLSPEC int SDLCALL SDL_JoystickAttachVirtualEx(const SDL_VirtualJoystickDesc *desc); extern DECLSPEC int SDLCALL SDL_AttachVirtualJoystickEx(const SDL_VirtualJoystickDesc *desc);
/** /**
* Detach a virtual joystick. * Detach a virtual joystick.
* *
* \param device_index a value previously returned from * \param device_index a value previously returned from
* SDL_JoystickAttachVirtual() * SDL_AttachVirtualJoystick()
* \returns 0 on success, or -1 if an error occurred. * \returns 0 on success, or -1 if an error occurred.
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
*/ */
extern DECLSPEC int SDLCALL SDL_JoystickDetachVirtual(int device_index); extern DECLSPEC int SDLCALL SDL_DetachVirtualJoystick(int device_index);
/** /**
* Query whether or not the joystick at a given device index is virtual. * Query whether or not the joystick at a given device index is virtual.
@ -423,13 +423,13 @@ extern DECLSPEC int SDLCALL SDL_JoystickDetachVirtual(int device_index);
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
*/ */
extern DECLSPEC SDL_bool SDLCALL SDL_JoystickIsVirtual(int device_index); extern DECLSPEC SDL_bool SDLCALL SDL_IsJoystickVirtual(int device_index);
/** /**
* Set values on an opened, virtual-joystick's axis. * Set values on an opened, virtual-joystick's axis.
* *
* Please note that values set here will not be applied until the next call to * Please note that values set here will not be applied until the next call to
* SDL_JoystickUpdate, which can either be called directly, or can be called * SDL_UpdateJoysticks, which can either be called directly, or can be called
* indirectly through various other SDL APIs, including, but not limited to * indirectly through various other SDL APIs, including, but not limited to
* the following: SDL_PollEvent, SDL_PumpEvents, SDL_WaitEventTimeout, * the following: SDL_PollEvent, SDL_PumpEvents, SDL_WaitEventTimeout,
* SDL_WaitEvent. * SDL_WaitEvent.
@ -445,13 +445,13 @@ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickIsVirtual(int device_index);
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
*/ */
extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualAxis(SDL_Joystick *joystick, int axis, Sint16 value); extern DECLSPEC int SDLCALL SDL_SetJoystickVirtualAxis(SDL_Joystick *joystick, int axis, Sint16 value);
/** /**
* Set values on an opened, virtual-joystick's button. * Set values on an opened, virtual-joystick's button.
* *
* Please note that values set here will not be applied until the next call to * Please note that values set here will not be applied until the next call to
* SDL_JoystickUpdate, which can either be called directly, or can be called * SDL_UpdateJoysticks, which can either be called directly, or can be called
* indirectly through various other SDL APIs, including, but not limited to * indirectly through various other SDL APIs, including, but not limited to
* the following: SDL_PollEvent, SDL_PumpEvents, SDL_WaitEventTimeout, * the following: SDL_PollEvent, SDL_PumpEvents, SDL_WaitEventTimeout,
* SDL_WaitEvent. * SDL_WaitEvent.
@ -463,13 +463,13 @@ extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualAxis(SDL_Joystick *joystick, i
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
*/ */
extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualButton(SDL_Joystick *joystick, int button, Uint8 value); extern DECLSPEC int SDLCALL SDL_SetJoystickVirtualButton(SDL_Joystick *joystick, int button, Uint8 value);
/** /**
* Set values on an opened, virtual-joystick's hat. * Set values on an opened, virtual-joystick's hat.
* *
* Please note that values set here will not be applied until the next call to * Please note that values set here will not be applied until the next call to
* SDL_JoystickUpdate, which can either be called directly, or can be called * SDL_UpdateJoysticks, which can either be called directly, or can be called
* indirectly through various other SDL APIs, including, but not limited to * indirectly through various other SDL APIs, including, but not limited to
* the following: SDL_PollEvent, SDL_PumpEvents, SDL_WaitEventTimeout, * the following: SDL_PollEvent, SDL_PumpEvents, SDL_WaitEventTimeout,
* SDL_WaitEvent. * SDL_WaitEvent.
@ -481,34 +481,34 @@ extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualButton(SDL_Joystick *joystick,
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
*/ */
extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualHat(SDL_Joystick *joystick, int hat, Uint8 value); extern DECLSPEC int SDLCALL SDL_SetJoystickVirtualHat(SDL_Joystick *joystick, int hat, Uint8 value);
/** /**
* Get the implementation dependent name of a joystick. * Get the implementation dependent name of a joystick.
* *
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() * \param joystick the SDL_Joystick obtained from SDL_OpenJoystick()
* \returns the name of the selected joystick. If no name can be found, this * \returns the name of the selected joystick. If no name can be found, this
* function returns NULL; call SDL_GetError() for more information. * function returns NULL; call SDL_GetError() for more information.
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_JoystickNameForIndex * \sa SDL_GetJoystickNameForIndex
* \sa SDL_JoystickOpen * \sa SDL_OpenJoystick
*/ */
extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick *joystick); extern DECLSPEC const char *SDLCALL SDL_GetJoystickName(SDL_Joystick *joystick);
/** /**
* Get the implementation dependent path of a joystick. * Get the implementation dependent path of a joystick.
* *
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() * \param joystick the SDL_Joystick obtained from SDL_OpenJoystick()
* \returns the path of the selected joystick. If no path can be found, this * \returns the path of the selected joystick. If no path can be found, this
* function returns NULL; call SDL_GetError() for more information. * function returns NULL; call SDL_GetError() for more information.
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_JoystickPathForIndex * \sa SDL_GetJoystickPathForIndex
*/ */
extern DECLSPEC const char *SDLCALL SDL_JoystickPath(SDL_Joystick *joystick); extern DECLSPEC const char *SDLCALL SDL_GetJoystickPath(SDL_Joystick *joystick);
/** /**
* Get the player index of an opened joystick. * Get the player index of an opened joystick.
@ -516,112 +516,112 @@ extern DECLSPEC const char *SDLCALL SDL_JoystickPath(SDL_Joystick *joystick);
* For XInput controllers this returns the XInput user index. Many joysticks * For XInput controllers this returns the XInput user index. Many joysticks
* will not be able to supply this information. * will not be able to supply this information.
* *
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() * \param joystick the SDL_Joystick obtained from SDL_OpenJoystick()
* \returns the player index, or -1 if it's not available. * \returns the player index, or -1 if it's not available.
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
*/ */
extern DECLSPEC int SDLCALL SDL_JoystickGetPlayerIndex(SDL_Joystick *joystick); extern DECLSPEC int SDLCALL SDL_GetJoystickPlayerIndex(SDL_Joystick *joystick);
/** /**
* Set the player index of an opened joystick. * Set the player index of an opened joystick.
* *
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() * \param joystick the SDL_Joystick obtained from SDL_OpenJoystick()
* \param player_index Player index to assign to this joystick, or -1 to clear * \param player_index Player index to assign to this joystick, or -1 to clear
* the player index and turn off player LEDs. * the player index and turn off player LEDs.
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
*/ */
extern DECLSPEC void SDLCALL SDL_JoystickSetPlayerIndex(SDL_Joystick *joystick, int player_index); extern DECLSPEC void SDLCALL SDL_SetJoystickPlayerIndex(SDL_Joystick *joystick, int player_index);
/** /**
* Get the implementation-dependent GUID for the joystick. * Get the implementation-dependent GUID for the joystick.
* *
* This function requires an open joystick. * This function requires an open joystick.
* *
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() * \param joystick the SDL_Joystick obtained from SDL_OpenJoystick()
* \returns the GUID of the given joystick. If called on an invalid index, * \returns the GUID of the given joystick. If called on an invalid index,
* this function returns a zero GUID; call SDL_GetError() for more * this function returns a zero GUID; call SDL_GetError() for more
* information. * information.
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_JoystickGetDeviceGUID * \sa SDL_GetJoystickDeviceGUID
* \sa SDL_JoystickGetGUIDString * \sa SDL_GetJoystickGUIDString
*/ */
extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUID(SDL_Joystick *joystick); extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetJoystickGUID(SDL_Joystick *joystick);
/** /**
* Get the USB vendor ID of an opened joystick, if available. * Get the USB vendor ID of an opened joystick, if available.
* *
* If the vendor ID isn't available this function returns 0. * If the vendor ID isn't available this function returns 0.
* *
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() * \param joystick the SDL_Joystick obtained from SDL_OpenJoystick()
* \returns the USB vendor ID of the selected joystick, or 0 if unavailable. * \returns the USB vendor ID of the selected joystick, or 0 if unavailable.
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
*/ */
extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetVendor(SDL_Joystick *joystick); extern DECLSPEC Uint16 SDLCALL SDL_GetJoystickVendor(SDL_Joystick *joystick);
/** /**
* Get the USB product ID of an opened joystick, if available. * Get the USB product ID of an opened joystick, if available.
* *
* If the product ID isn't available this function returns 0. * If the product ID isn't available this function returns 0.
* *
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() * \param joystick the SDL_Joystick obtained from SDL_OpenJoystick()
* \returns the USB product ID of the selected joystick, or 0 if unavailable. * \returns the USB product ID of the selected joystick, or 0 if unavailable.
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
*/ */
extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProduct(SDL_Joystick *joystick); extern DECLSPEC Uint16 SDLCALL SDL_GetJoystickProduct(SDL_Joystick *joystick);
/** /**
* Get the product version of an opened joystick, if available. * Get the product version of an opened joystick, if available.
* *
* If the product version isn't available this function returns 0. * If the product version isn't available this function returns 0.
* *
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() * \param joystick the SDL_Joystick obtained from SDL_OpenJoystick()
* \returns the product version of the selected joystick, or 0 if unavailable. * \returns the product version of the selected joystick, or 0 if unavailable.
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
*/ */
extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProductVersion(SDL_Joystick *joystick); extern DECLSPEC Uint16 SDLCALL SDL_GetJoystickProductVersion(SDL_Joystick *joystick);
/** /**
* Get the firmware version of an opened joystick, if available. * Get the firmware version of an opened joystick, if available.
* *
* If the firmware version isn't available this function returns 0. * If the firmware version isn't available this function returns 0.
* *
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() * \param joystick the SDL_Joystick obtained from SDL_OpenJoystick()
* \returns the firmware version of the selected joystick, or 0 if * \returns the firmware version of the selected joystick, or 0 if
* unavailable. * unavailable.
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
*/ */
extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetFirmwareVersion(SDL_Joystick *joystick); extern DECLSPEC Uint16 SDLCALL SDL_GetJoystickFirmwareVersion(SDL_Joystick *joystick);
/** /**
* Get the serial number of an opened joystick, if available. * Get the serial number of an opened joystick, if available.
* *
* Returns the serial number of the joystick, or NULL if it is not available. * Returns the serial number of the joystick, or NULL if it is not available.
* *
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() * \param joystick the SDL_Joystick obtained from SDL_OpenJoystick()
* \returns the serial number of the selected joystick, or NULL if * \returns the serial number of the selected joystick, or NULL if
* unavailable. * unavailable.
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
*/ */
extern DECLSPEC const char * SDLCALL SDL_JoystickGetSerial(SDL_Joystick *joystick); extern DECLSPEC const char * SDLCALL SDL_GetJoystickSerial(SDL_Joystick *joystick);
/** /**
* Get the type of an opened joystick. * Get the type of an opened joystick.
* *
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() * \param joystick the SDL_Joystick obtained from SDL_OpenJoystick()
* \returns the SDL_JoystickType of the selected joystick. * \returns the SDL_JoystickType of the selected joystick.
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
*/ */
extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetType(SDL_Joystick *joystick); extern DECLSPEC SDL_JoystickType SDLCALL SDL_GetJoystickType(SDL_Joystick *joystick);
/** /**
* Get an ASCII string representation for a given SDL_JoystickGUID. * Get an ASCII string representation for a given SDL_JoystickGUID.
@ -634,11 +634,11 @@ extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetType(SDL_Joystick *joyst
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_JoystickGetDeviceGUID * \sa SDL_GetJoystickDeviceGUID
* \sa SDL_JoystickGetGUID * \sa SDL_GetJoystickGUID
* \sa SDL_JoystickGetGUIDFromString * \sa SDL_GetJoystickGUIDFromString
*/ */
extern DECLSPEC void SDLCALL SDL_JoystickGetGUIDString(SDL_JoystickGUID guid, char *pszGUID, int cbGUID); extern DECLSPEC void SDLCALL SDL_GetJoystickGUIDString(SDL_JoystickGUID guid, char *pszGUID, int cbGUID);
/** /**
* Convert a GUID string into a SDL_JoystickGUID structure. * Convert a GUID string into a SDL_JoystickGUID structure.
@ -652,9 +652,9 @@ extern DECLSPEC void SDLCALL SDL_JoystickGetGUIDString(SDL_JoystickGUID guid, ch
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_JoystickGetGUIDString * \sa SDL_GetJoystickGUIDString
*/ */
extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUIDFromString(const char *pchGUID); extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetJoystickGUIDFromString(const char *pchGUID);
/** /**
* Get the device information encoded in a SDL_JoystickGUID structure * Get the device information encoded in a SDL_JoystickGUID structure
@ -671,7 +671,7 @@ extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUIDFromString(const cha
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_JoystickGetDeviceGUID * \sa SDL_GetJoystickDeviceGUID
*/ */
extern DECLSPEC void SDLCALL SDL_GetJoystickGUIDInfo(SDL_JoystickGUID guid, Uint16 *vendor, Uint16 *product, Uint16 *version, Uint16 *crc16); extern DECLSPEC void SDLCALL SDL_GetJoystickGUIDInfo(SDL_JoystickGUID guid, Uint16 *vendor, Uint16 *product, Uint16 *version, Uint16 *crc16);
@ -684,10 +684,10 @@ extern DECLSPEC void SDLCALL SDL_GetJoystickGUIDInfo(SDL_JoystickGUID guid, Uint
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_JoystickClose * \sa SDL_CloseJoystick
* \sa SDL_JoystickOpen * \sa SDL_OpenJoystick
*/ */
extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAttached(SDL_Joystick *joystick); extern DECLSPEC SDL_bool SDLCALL SDL_IsJoystickConnected(SDL_Joystick *joystick);
/** /**
* Get the instance ID of an opened joystick. * Get the instance ID of an opened joystick.
@ -698,9 +698,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAttached(SDL_Joystick *joystick)
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_JoystickOpen * \sa SDL_OpenJoystick
*/ */
extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickInstanceID(SDL_Joystick *joystick); extern DECLSPEC SDL_JoystickID SDLCALL SDL_GetJoystickInstanceID(SDL_Joystick *joystick);
/** /**
* Get the number of general axis controls on a joystick. * Get the number of general axis controls on a joystick.
@ -716,10 +716,10 @@ extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickInstanceID(SDL_Joystick *joys
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_JoystickGetAxis * \sa SDL_GetJoystickAxis
* \sa SDL_JoystickOpen * \sa SDL_OpenJoystick
*/ */
extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick *joystick); extern DECLSPEC int SDLCALL SDL_GetNumJoystickAxes(SDL_Joystick *joystick);
/** /**
* Get the number of POV hats on a joystick. * Get the number of POV hats on a joystick.
@ -730,10 +730,10 @@ extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick *joystick);
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_JoystickGetHat * \sa SDL_GetJoystickHat
* \sa SDL_JoystickOpen * \sa SDL_OpenJoystick
*/ */
extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick *joystick); extern DECLSPEC int SDLCALL SDL_GetNumJoystickHats(SDL_Joystick *joystick);
/** /**
* Get the number of buttons on a joystick. * Get the number of buttons on a joystick.
@ -744,10 +744,10 @@ extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick *joystick);
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_JoystickGetButton * \sa SDL_GetJoystickButton
* \sa SDL_JoystickOpen * \sa SDL_OpenJoystick
*/ */
extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick *joystick); extern DECLSPEC int SDLCALL SDL_GetNumJoystickButtons(SDL_Joystick *joystick);
/** /**
* Update the current state of the open joysticks. * Update the current state of the open joysticks.
@ -757,14 +757,14 @@ extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick *joystick);
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_JoystickEventState * \sa SDL_GetJoystickEventState
*/ */
extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void); extern DECLSPEC void SDLCALL SDL_UpdateJoysticks(void);
/** /**
* Enable/disable joystick event polling. * Enable/disable joystick event polling.
* *
* If joystick events are disabled, you must call SDL_JoystickUpdate() * If joystick events are disabled, you must call SDL_UpdateJoysticks()
* yourself and manually check the state of the joystick when you want * yourself and manually check the state of the joystick when you want
* joystick information. * joystick information.
* *
@ -784,7 +784,7 @@ extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void);
* *
* \sa SDL_GameControllerEventState * \sa SDL_GameControllerEventState
*/ */
extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state); extern DECLSPEC int SDLCALL SDL_GetJoystickEventState(int state);
#define SDL_JOYSTICK_AXIS_MAX 32767 #define SDL_JOYSTICK_AXIS_MAX 32767
#define SDL_JOYSTICK_AXIS_MIN -32768 #define SDL_JOYSTICK_AXIS_MIN -32768
@ -798,7 +798,7 @@ extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state);
* Game Controller API makes a great effort to apply order to this lower-level * Game Controller API makes a great effort to apply order to this lower-level
* interface, so you know that a specific axis is the "left thumb stick," etc. * interface, so you know that a specific axis is the "left thumb stick," etc.
* *
* The value returned by SDL_JoystickGetAxis() is a signed integer (-32768 to * The value returned by SDL_GetJoystickAxis() is a signed integer (-32768 to
* 32767) representing the current position of the axis. It may be necessary * 32767) representing the current position of the axis. It may be necessary
* to impose certain tolerances on these values to account for jitter. * to impose certain tolerances on these values to account for jitter.
* *
@ -809,9 +809,9 @@ extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state);
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_JoystickNumAxes * \sa SDL_GetNumJoystickAxes
*/ */
extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick *joystick, extern DECLSPEC Sint16 SDLCALL SDL_GetJoystickAxis(SDL_Joystick *joystick,
int axis); int axis);
/** /**
@ -828,7 +828,7 @@ extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick *joystick,
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
*/ */
extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAxisInitialState(SDL_Joystick *joystick, extern DECLSPEC SDL_bool SDLCALL SDL_GetJoystickAxisInitialState(SDL_Joystick *joystick,
int axis, Sint16 *state); int axis, Sint16 *state);
/** /**
@ -867,9 +867,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAxisInitialState(SDL_Joystick *j
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_JoystickNumHats * \sa SDL_GetNumJoystickHats
*/ */
extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick *joystick, extern DECLSPEC Uint8 SDLCALL SDL_GetJoystickHat(SDL_Joystick *joystick,
int hat); int hat);
/** /**
@ -882,9 +882,9 @@ extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick *joystick,
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_JoystickNumButtons * \sa SDL_GetNumJoystickButtons
*/ */
extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick *joystick, extern DECLSPEC Uint8 SDLCALL SDL_GetJoystickButton(SDL_Joystick *joystick,
int button); int button);
/** /**
@ -905,7 +905,7 @@ extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick *joystick,
* *
* \sa SDL_JoystickHasRumble * \sa SDL_JoystickHasRumble
*/ */
extern DECLSPEC int SDLCALL SDL_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms); extern DECLSPEC int SDLCALL SDL_RumbleJoystick(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms);
/** /**
* Start a rumble effect in the joystick's triggers * Start a rumble effect in the joystick's triggers
@ -915,7 +915,7 @@ extern DECLSPEC int SDLCALL SDL_JoystickRumble(SDL_Joystick *joystick, Uint16 lo
* *
* Note that this is rumbling of the _triggers_ and not the game controller as * Note that this is rumbling of the _triggers_ and not the game controller as
* a whole. This is currently only supported on Xbox One controllers. If you * a whole. This is currently only supported on Xbox One controllers. If you
* want the (more common) whole-controller rumble, use SDL_JoystickRumble() * want the (more common) whole-controller rumble, use SDL_RumbleJoystick()
* instead. * instead.
* *
* \param joystick The joystick to vibrate * \param joystick The joystick to vibrate
@ -930,7 +930,7 @@ extern DECLSPEC int SDLCALL SDL_JoystickRumble(SDL_Joystick *joystick, Uint16 lo
* *
* \sa SDL_JoystickHasRumbleTriggers * \sa SDL_JoystickHasRumbleTriggers
*/ */
extern DECLSPEC int SDLCALL SDL_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms); extern DECLSPEC int SDLCALL SDL_RumbleJoystickTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms);
/** /**
* Query whether a joystick has an LED. * Query whether a joystick has an LED.
@ -953,7 +953,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasLED(SDL_Joystick *joystick);
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_JoystickRumble * \sa SDL_RumbleJoystick
*/ */
extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasRumble(SDL_Joystick *joystick); extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasRumble(SDL_Joystick *joystick);
@ -965,7 +965,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasRumble(SDL_Joystick *joystick);
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_JoystickRumbleTriggers * \sa SDL_RumbleJoystickTriggers
*/ */
extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasRumbleTriggers(SDL_Joystick *joystick); extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasRumbleTriggers(SDL_Joystick *joystick);
@ -983,7 +983,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasRumbleTriggers(SDL_Joystick *joy
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
*/ */
extern DECLSPEC int SDLCALL SDL_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue); extern DECLSPEC int SDLCALL SDL_SetJoystickLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue);
/** /**
* Send a joystick specific effect packet * Send a joystick specific effect packet
@ -995,18 +995,18 @@ extern DECLSPEC int SDLCALL SDL_JoystickSetLED(SDL_Joystick *joystick, Uint8 red
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
*/ */
extern DECLSPEC int SDLCALL SDL_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size); extern DECLSPEC int SDLCALL SDL_SendJoystickEffect(SDL_Joystick *joystick, const void *data, int size);
/** /**
* Close a joystick previously opened with SDL_JoystickOpen(). * Close a joystick previously opened with SDL_OpenJoystick().
* *
* \param joystick The joystick device to close * \param joystick The joystick device to close
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_JoystickOpen * \sa SDL_OpenJoystick
*/ */
extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick *joystick); extern DECLSPEC void SDLCALL SDL_CloseJoystick(SDL_Joystick *joystick);
/** /**
* Get the battery level of a joystick as SDL_JoystickPowerLevel. * Get the battery level of a joystick as SDL_JoystickPowerLevel.
@ -1017,7 +1017,7 @@ extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick *joystick);
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
*/ */
extern DECLSPEC SDL_JoystickPowerLevel SDLCALL SDL_JoystickCurrentPowerLevel(SDL_Joystick *joystick); extern DECLSPEC SDL_JoystickPowerLevel SDLCALL SDL_GetJoystickPowerLevel(SDL_Joystick *joystick);
/* Ends C function definitions when using C++ */ /* Ends C function definitions when using C++ */
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -49,6 +49,58 @@
#define SDL_FreeWAV SDL_free #define SDL_FreeWAV SDL_free
#define SDL_NewAudioStream SDL_CreateAudioStream #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 */ /* ##SDL_keycode.h */
#define KMOD_ALT SDL_KMOD_ALT #define KMOD_ALT SDL_KMOD_ALT
#define KMOD_CAPS SDL_KMOD_CAPS #define KMOD_CAPS SDL_KMOD_CAPS
@ -94,6 +146,58 @@
#define SDL_FreeWAV SDL_FreeWAV_renamed_SDL_free #define SDL_FreeWAV SDL_FreeWAV_renamed_SDL_free
#define SDL_NewAudioStream SDL_NewAudioStream_renamed_SDL_CreateAudioStream #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 */ /* ##SDL_keycode.h */
#define KMOD_ALT KMOD_ALT_renamed_SDL_KMOD_ALT #define KMOD_ALT KMOD_ALT_renamed_SDL_KMOD_ALT
#define KMOD_CAPS KMOD_CAPS_renamed_SDL_KMOD_CAPS #define KMOD_CAPS KMOD_CAPS_renamed_SDL_KMOD_CAPS

View File

@ -696,60 +696,60 @@ SDL3_0.0.0 {
SDL_ComposeCustomBlendMode; SDL_ComposeCustomBlendMode;
SDL_LockJoysticks; SDL_LockJoysticks;
SDL_UnlockJoysticks; SDL_UnlockJoysticks;
SDL_NumJoysticks; SDL_GetNumJoysticks;
SDL_JoystickNameForIndex; SDL_GetJoystickNameForIndex;
SDL_JoystickPathForIndex; SDL_GetJoystickPathForIndex;
SDL_JoystickGetDevicePlayerIndex; SDL_GetJoystickDevicePlayerIndex;
SDL_JoystickGetDeviceGUID; SDL_GetJoystickDeviceGUID;
SDL_JoystickGetDeviceVendor; SDL_GetJoystickDeviceVendor;
SDL_JoystickGetDeviceProduct; SDL_GetJoystickDeviceProduct;
SDL_JoystickGetDeviceProductVersion; SDL_GetJoystickDeviceProductVersion;
SDL_JoystickGetDeviceType; SDL_GetJoystickDeviceType;
SDL_JoystickGetDeviceInstanceID; SDL_GetJoystickDeviceInstanceID;
SDL_JoystickOpen; SDL_OpenJoystick;
SDL_JoystickFromInstanceID; SDL_GetJoystickFromInstanceID;
SDL_JoystickFromPlayerIndex; SDL_GetJoystickFromPlayerIndex;
SDL_JoystickAttachVirtual; SDL_AttachVirtualJoystick;
SDL_JoystickAttachVirtualEx; SDL_AttachVirtualJoystickEx;
SDL_JoystickDetachVirtual; SDL_DetachVirtualJoystick;
SDL_JoystickIsVirtual; SDL_IsJoystickVirtual;
SDL_JoystickSetVirtualAxis; SDL_SetJoystickVirtualAxis;
SDL_JoystickSetVirtualButton; SDL_SetJoystickVirtualButton;
SDL_JoystickSetVirtualHat; SDL_SetJoystickVirtualHat;
SDL_JoystickName; SDL_GetJoystickName;
SDL_JoystickPath; SDL_GetJoystickPath;
SDL_JoystickGetPlayerIndex; SDL_GetJoystickPlayerIndex;
SDL_JoystickSetPlayerIndex; SDL_SetJoystickPlayerIndex;
SDL_JoystickGetGUID; SDL_GetJoystickGUID;
SDL_JoystickGetVendor; SDL_GetJoystickVendor;
SDL_JoystickGetProduct; SDL_GetJoystickProduct;
SDL_JoystickGetProductVersion; SDL_GetJoystickProductVersion;
SDL_JoystickGetFirmwareVersion; SDL_GetJoystickFirmwareVersion;
SDL_JoystickGetSerial; SDL_GetJoystickSerial;
SDL_JoystickGetType; SDL_GetJoystickType;
SDL_JoystickGetGUIDString; SDL_GetJoystickGUIDString;
SDL_JoystickGetGUIDFromString; SDL_GetJoystickGUIDFromString;
SDL_GetJoystickGUIDInfo; SDL_GetJoystickGUIDInfo;
SDL_JoystickGetAttached; SDL_IsJoystickConnected;
SDL_JoystickInstanceID; SDL_GetJoystickInstanceID;
SDL_JoystickNumAxes; SDL_GetNumJoystickAxes;
SDL_JoystickNumHats; SDL_GetNumJoystickHats;
SDL_JoystickNumButtons; SDL_GetNumJoystickButtons;
SDL_JoystickUpdate; SDL_UpdateJoysticks;
SDL_JoystickEventState; SDL_GetJoystickEventState;
SDL_JoystickGetAxis; SDL_GetJoystickAxis;
SDL_JoystickGetAxisInitialState; SDL_GetJoystickAxisInitialState;
SDL_JoystickGetHat; SDL_GetJoystickHat;
SDL_JoystickGetButton; SDL_GetJoystickButton;
SDL_JoystickRumble; SDL_RumbleJoystick;
SDL_JoystickRumbleTriggers; SDL_RumbleJoystickTriggers;
SDL_JoystickHasLED; SDL_JoystickHasLED;
SDL_JoystickHasRumble; SDL_JoystickHasRumble;
SDL_JoystickHasRumbleTriggers; SDL_JoystickHasRumbleTriggers;
SDL_JoystickSetLED; SDL_SetJoystickLED;
SDL_JoystickSendEffect; SDL_SendJoystickEffect;
SDL_JoystickClose; SDL_CloseJoystick;
SDL_JoystickCurrentPowerLevel; SDL_GetJoystickPowerLevel;
SDL_Metal_CreateView; SDL_Metal_CreateView;
SDL_Metal_DestroyView; SDL_Metal_DestroyView;
SDL_Metal_GetLayer; SDL_Metal_GetLayer;

View File

@ -182,25 +182,25 @@
#define SDL_AddHintCallback SDL_AddHintCallback_REAL #define SDL_AddHintCallback SDL_AddHintCallback_REAL
#define SDL_DelHintCallback SDL_DelHintCallback_REAL #define SDL_DelHintCallback SDL_DelHintCallback_REAL
#define SDL_ClearHints SDL_ClearHints_REAL #define SDL_ClearHints SDL_ClearHints_REAL
#define SDL_NumJoysticks SDL_NumJoysticks_REAL #define SDL_GetNumJoysticks SDL_GetNumJoysticks_REAL
#define SDL_JoystickNameForIndex SDL_JoystickNameForIndex_REAL #define SDL_GetJoystickNameForIndex SDL_GetJoystickNameForIndex_REAL
#define SDL_JoystickOpen SDL_JoystickOpen_REAL #define SDL_OpenJoystick SDL_OpenJoystick_REAL
#define SDL_JoystickName SDL_JoystickName_REAL #define SDL_GetJoystickName SDL_GetJoystickName_REAL
#define SDL_JoystickGetDeviceGUID SDL_JoystickGetDeviceGUID_REAL #define SDL_GetJoystickDeviceGUID SDL_GetJoystickDeviceGUID_REAL
#define SDL_JoystickGetGUID SDL_JoystickGetGUID_REAL #define SDL_GetJoystickGUID SDL_GetJoystickGUID_REAL
#define SDL_JoystickGetGUIDString SDL_JoystickGetGUIDString_REAL #define SDL_GetJoystickGUIDString SDL_GetJoystickGUIDString_REAL
#define SDL_JoystickGetGUIDFromString SDL_JoystickGetGUIDFromString_REAL #define SDL_GetJoystickGUIDFromString SDL_GetJoystickGUIDFromString_REAL
#define SDL_JoystickGetAttached SDL_JoystickGetAttached_REAL #define SDL_IsJoystickConnected SDL_IsJoystickConnected_REAL
#define SDL_JoystickInstanceID SDL_JoystickInstanceID_REAL #define SDL_GetJoystickInstanceID SDL_GetJoystickInstanceID_REAL
#define SDL_JoystickNumAxes SDL_JoystickNumAxes_REAL #define SDL_GetNumJoystickAxes SDL_GetNumJoystickAxes_REAL
#define SDL_JoystickNumHats SDL_JoystickNumHats_REAL #define SDL_GetNumJoystickHats SDL_GetNumJoystickHats_REAL
#define SDL_JoystickNumButtons SDL_JoystickNumButtons_REAL #define SDL_GetNumJoystickButtons SDL_GetNumJoystickButtons_REAL
#define SDL_JoystickUpdate SDL_JoystickUpdate_REAL #define SDL_UpdateJoysticks SDL_UpdateJoysticks_REAL
#define SDL_JoystickEventState SDL_JoystickEventState_REAL #define SDL_GetJoystickEventState SDL_GetJoystickEventState_REAL
#define SDL_JoystickGetAxis SDL_JoystickGetAxis_REAL #define SDL_GetJoystickAxis SDL_GetJoystickAxis_REAL
#define SDL_JoystickGetHat SDL_JoystickGetHat_REAL #define SDL_GetJoystickHat SDL_GetJoystickHat_REAL
#define SDL_JoystickGetButton SDL_JoystickGetButton_REAL #define SDL_GetJoystickButton SDL_GetJoystickButton_REAL
#define SDL_JoystickClose SDL_JoystickClose_REAL #define SDL_CloseJoystick SDL_CloseJoystick_REAL
#define SDL_GetKeyboardFocus SDL_GetKeyboardFocus_REAL #define SDL_GetKeyboardFocus SDL_GetKeyboardFocus_REAL
#define SDL_GetKeyboardState SDL_GetKeyboardState_REAL #define SDL_GetKeyboardState SDL_GetKeyboardState_REAL
#define SDL_GetModState SDL_GetModState_REAL #define SDL_GetModState SDL_GetModState_REAL
@ -562,9 +562,9 @@
#define SDL_ClearQueuedAudio SDL_ClearQueuedAudio_REAL #define SDL_ClearQueuedAudio SDL_ClearQueuedAudio_REAL
#define SDL_GetGrabbedWindow SDL_GetGrabbedWindow_REAL #define SDL_GetGrabbedWindow SDL_GetGrabbedWindow_REAL
#define SDL_SetWindowsMessageHook SDL_SetWindowsMessageHook_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_GameControllerFromInstanceID SDL_GameControllerFromInstanceID_REAL
#define SDL_JoystickFromInstanceID SDL_JoystickFromInstanceID_REAL #define SDL_GetJoystickFromInstanceID SDL_GetJoystickFromInstanceID_REAL
#define SDL_GetDisplayUsableBounds SDL_GetDisplayUsableBounds_REAL #define SDL_GetDisplayUsableBounds SDL_GetDisplayUsableBounds_REAL
#define SDL_GetWindowBordersSize SDL_GetWindowBordersSize_REAL #define SDL_GetWindowBordersSize SDL_GetWindowBordersSize_REAL
#define SDL_SetWindowOpacity SDL_SetWindowOpacity_REAL #define SDL_SetWindowOpacity SDL_SetWindowOpacity_REAL
@ -578,24 +578,24 @@
#define SDL_CreateSurface SDL_CreateSurface_REAL #define SDL_CreateSurface SDL_CreateSurface_REAL
#define SDL_CreateSurfaceFrom SDL_CreateSurfaceFrom_REAL #define SDL_CreateSurfaceFrom SDL_CreateSurfaceFrom_REAL
#define SDL_GetHintBoolean SDL_GetHintBoolean_REAL #define SDL_GetHintBoolean SDL_GetHintBoolean_REAL
#define SDL_JoystickGetDeviceVendor SDL_JoystickGetDeviceVendor_REAL #define SDL_GetJoystickDeviceVendor SDL_GetJoystickDeviceVendor_REAL
#define SDL_JoystickGetDeviceProduct SDL_JoystickGetDeviceProduct_REAL #define SDL_GetJoystickDeviceProduct SDL_GetJoystickDeviceProduct_REAL
#define SDL_JoystickGetDeviceProductVersion SDL_JoystickGetDeviceProductVersion_REAL #define SDL_GetJoystickDeviceProductVersion SDL_GetJoystickDeviceProductVersion_REAL
#define SDL_JoystickGetVendor SDL_JoystickGetVendor_REAL #define SDL_GetJoystickVendor SDL_GetJoystickVendor_REAL
#define SDL_JoystickGetProduct SDL_JoystickGetProduct_REAL #define SDL_GetJoystickProduct SDL_GetJoystickProduct_REAL
#define SDL_JoystickGetProductVersion SDL_JoystickGetProductVersion_REAL #define SDL_GetJoystickProductVersion SDL_GetJoystickProductVersion_REAL
#define SDL_GameControllerGetVendor SDL_GameControllerGetVendor_REAL #define SDL_GameControllerGetVendor SDL_GameControllerGetVendor_REAL
#define SDL_GameControllerGetProduct SDL_GameControllerGetProduct_REAL #define SDL_GameControllerGetProduct SDL_GameControllerGetProduct_REAL
#define SDL_GameControllerGetProductVersion SDL_GameControllerGetProductVersion_REAL #define SDL_GameControllerGetProductVersion SDL_GameControllerGetProductVersion_REAL
#define SDL_HasNEON SDL_HasNEON_REAL #define SDL_HasNEON SDL_HasNEON_REAL
#define SDL_GameControllerNumMappings SDL_GameControllerNumMappings_REAL #define SDL_GameControllerNumMappings SDL_GameControllerNumMappings_REAL
#define SDL_GameControllerMappingForIndex SDL_GameControllerMappingForIndex_REAL #define SDL_GameControllerMappingForIndex SDL_GameControllerMappingForIndex_REAL
#define SDL_JoystickGetAxisInitialState SDL_JoystickGetAxisInitialState_REAL #define SDL_GetJoystickAxisInitialState SDL_GetJoystickAxisInitialState_REAL
#define SDL_JoystickGetDeviceType SDL_JoystickGetDeviceType_REAL #define SDL_GetJoystickDeviceType SDL_GetJoystickDeviceType_REAL
#define SDL_JoystickGetType SDL_JoystickGetType_REAL #define SDL_GetJoystickType SDL_GetJoystickType_REAL
#define SDL_MemoryBarrierReleaseFunction SDL_MemoryBarrierReleaseFunction_REAL #define SDL_MemoryBarrierReleaseFunction SDL_MemoryBarrierReleaseFunction_REAL
#define SDL_MemoryBarrierAcquireFunction SDL_MemoryBarrierAcquireFunction_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_utf8strlen SDL_utf8strlen_REAL
#define SDL_LoadFile_RW SDL_LoadFile_RW_REAL #define SDL_LoadFile_RW SDL_LoadFile_RW_REAL
#define SDL_wcscmp SDL_wcscmp_REAL #define SDL_wcscmp SDL_wcscmp_REAL
@ -651,7 +651,7 @@
#define SDL_expf SDL_expf_REAL #define SDL_expf SDL_expf_REAL
#define SDL_wcsdup SDL_wcsdup_REAL #define SDL_wcsdup SDL_wcsdup_REAL
#define SDL_GameControllerRumble SDL_GameControllerRumble_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_NumSensors SDL_NumSensors_REAL
#define SDL_SensorGetDeviceName SDL_SensorGetDeviceName_REAL #define SDL_SensorGetDeviceName SDL_SensorGetDeviceName_REAL
#define SDL_SensorGetDeviceType SDL_SensorGetDeviceType_REAL #define SDL_SensorGetDeviceType SDL_SensorGetDeviceType_REAL
@ -670,8 +670,8 @@
#define SDL_GetDisplayOrientation SDL_GetDisplayOrientation_REAL #define SDL_GetDisplayOrientation SDL_GetDisplayOrientation_REAL
#define SDL_HasColorKey SDL_HasColorKey_REAL #define SDL_HasColorKey SDL_HasColorKey_REAL
#define SDL_CreateThreadWithStackSize SDL_CreateThreadWithStackSize_REAL #define SDL_CreateThreadWithStackSize SDL_CreateThreadWithStackSize_REAL
#define SDL_JoystickGetDevicePlayerIndex SDL_JoystickGetDevicePlayerIndex_REAL #define SDL_GetJoystickDevicePlayerIndex SDL_GetJoystickDevicePlayerIndex_REAL
#define SDL_JoystickGetPlayerIndex SDL_JoystickGetPlayerIndex_REAL #define SDL_GetJoystickPlayerIndex SDL_GetJoystickPlayerIndex_REAL
#define SDL_GameControllerGetPlayerIndex SDL_GameControllerGetPlayerIndex_REAL #define SDL_GameControllerGetPlayerIndex SDL_GameControllerGetPlayerIndex_REAL
#define SDL_RenderFlush SDL_RenderFlush_REAL #define SDL_RenderFlush SDL_RenderFlush_REAL
#define SDL_RenderDrawPointF SDL_RenderDrawPointF_REAL #define SDL_RenderDrawPointF SDL_RenderDrawPointF_REAL
@ -706,8 +706,8 @@
#define SDL_GameControllerGetType SDL_GameControllerGetType_REAL #define SDL_GameControllerGetType SDL_GameControllerGetType_REAL
#define SDL_GameControllerFromPlayerIndex SDL_GameControllerFromPlayerIndex_REAL #define SDL_GameControllerFromPlayerIndex SDL_GameControllerFromPlayerIndex_REAL
#define SDL_GameControllerSetPlayerIndex SDL_GameControllerSetPlayerIndex_REAL #define SDL_GameControllerSetPlayerIndex SDL_GameControllerSetPlayerIndex_REAL
#define SDL_JoystickFromPlayerIndex SDL_JoystickFromPlayerIndex_REAL #define SDL_GetJoystickFromPlayerIndex SDL_GetJoystickFromPlayerIndex_REAL
#define SDL_JoystickSetPlayerIndex SDL_JoystickSetPlayerIndex_REAL #define SDL_SetJoystickPlayerIndex SDL_SetJoystickPlayerIndex_REAL
#define SDL_SetTextureScaleMode SDL_SetTextureScaleMode_REAL #define SDL_SetTextureScaleMode SDL_SetTextureScaleMode_REAL
#define SDL_GetTextureScaleMode SDL_GetTextureScaleMode_REAL #define SDL_GetTextureScaleMode SDL_GetTextureScaleMode_REAL
#define SDL_OnApplicationWillTerminate SDL_OnApplicationWillTerminate_REAL #define SDL_OnApplicationWillTerminate SDL_OnApplicationWillTerminate_REAL
@ -720,12 +720,12 @@
#define SDL_GetAndroidSDKVersion SDL_GetAndroidSDKVersion_REAL #define SDL_GetAndroidSDKVersion SDL_GetAndroidSDKVersion_REAL
#define SDL_isupper SDL_isupper_REAL #define SDL_isupper SDL_isupper_REAL
#define SDL_islower SDL_islower_REAL #define SDL_islower SDL_islower_REAL
#define SDL_JoystickAttachVirtual SDL_JoystickAttachVirtual_REAL #define SDL_AttachVirtualJoystick SDL_AttachVirtualJoystick_REAL
#define SDL_JoystickDetachVirtual SDL_JoystickDetachVirtual_REAL #define SDL_DetachVirtualJoystick SDL_DetachVirtualJoystick_REAL
#define SDL_JoystickIsVirtual SDL_JoystickIsVirtual_REAL #define SDL_IsJoystickVirtual SDL_IsJoystickVirtual_REAL
#define SDL_JoystickSetVirtualAxis SDL_JoystickSetVirtualAxis_REAL #define SDL_SetJoystickVirtualAxis SDL_SetJoystickVirtualAxis_REAL
#define SDL_JoystickSetVirtualButton SDL_JoystickSetVirtualButton_REAL #define SDL_SetJoystickVirtualButton SDL_SetJoystickVirtualButton_REAL
#define SDL_JoystickSetVirtualHat SDL_JoystickSetVirtualHat_REAL #define SDL_SetJoystickVirtualHat SDL_SetJoystickVirtualHat_REAL
#define SDL_GetErrorMsg SDL_GetErrorMsg_REAL #define SDL_GetErrorMsg SDL_GetErrorMsg_REAL
#define SDL_LockSensors SDL_LockSensors_REAL #define SDL_LockSensors SDL_LockSensors_REAL
#define SDL_UnlockSensors SDL_UnlockSensors_REAL #define SDL_UnlockSensors SDL_UnlockSensors_REAL
@ -741,9 +741,9 @@
#define SDL_GameControllerHasLED SDL_GameControllerHasLED_REAL #define SDL_GameControllerHasLED SDL_GameControllerHasLED_REAL
#define SDL_GameControllerSetLED SDL_GameControllerSetLED_REAL #define SDL_GameControllerSetLED SDL_GameControllerSetLED_REAL
#define SDL_JoystickHasLED SDL_JoystickHasLED_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_GameControllerRumbleTriggers SDL_GameControllerRumbleTriggers_REAL
#define SDL_JoystickRumbleTriggers SDL_JoystickRumbleTriggers_REAL #define SDL_RumbleJoystickTriggers SDL_RumbleJoystickTriggers_REAL
#define SDL_GameControllerHasAxis SDL_GameControllerHasAxis_REAL #define SDL_GameControllerHasAxis SDL_GameControllerHasAxis_REAL
#define SDL_GameControllerHasButton SDL_GameControllerHasButton_REAL #define SDL_GameControllerHasButton SDL_GameControllerHasButton_REAL
#define SDL_GameControllerGetNumTouchpads SDL_GameControllerGetNumTouchpads_REAL #define SDL_GameControllerGetNumTouchpads SDL_GameControllerGetNumTouchpads_REAL
@ -751,7 +751,7 @@
#define SDL_GameControllerGetTouchpadFinger SDL_GameControllerGetTouchpadFinger_REAL #define SDL_GameControllerGetTouchpadFinger SDL_GameControllerGetTouchpadFinger_REAL
#define SDL_crc32 SDL_crc32_REAL #define SDL_crc32 SDL_crc32_REAL
#define SDL_GameControllerGetSerial SDL_GameControllerGetSerial_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_GameControllerHasSensor SDL_GameControllerHasSensor_REAL
#define SDL_GameControllerSetSensorEnabled SDL_GameControllerSetSensorEnabled_REAL #define SDL_GameControllerSetSensorEnabled SDL_GameControllerSetSensorEnabled_REAL
#define SDL_GameControllerIsSensorEnabled SDL_GameControllerIsSensorEnabled_REAL #define SDL_GameControllerIsSensorEnabled SDL_GameControllerIsSensorEnabled_REAL
@ -783,7 +783,7 @@
#define SDL_SetWindowAlwaysOnTop SDL_SetWindowAlwaysOnTop_REAL #define SDL_SetWindowAlwaysOnTop SDL_SetWindowAlwaysOnTop_REAL
#define SDL_FlashWindow SDL_FlashWindow_REAL #define SDL_FlashWindow SDL_FlashWindow_REAL
#define SDL_GameControllerSendEffect SDL_GameControllerSendEffect_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_GameControllerGetSensorDataRate SDL_GameControllerGetSensorDataRate_REAL
#define SDL_SetTextureUserData SDL_SetTextureUserData_REAL #define SDL_SetTextureUserData SDL_SetTextureUserData_REAL
#define SDL_GetTextureUserData SDL_GetTextureUserData_REAL #define SDL_GetTextureUserData SDL_GetTextureUserData_REAL
@ -837,11 +837,11 @@
#define SDL_bsearch SDL_bsearch_REAL #define SDL_bsearch SDL_bsearch_REAL
#define SDL_GameControllerPathForIndex SDL_GameControllerPathForIndex_REAL #define SDL_GameControllerPathForIndex SDL_GameControllerPathForIndex_REAL
#define SDL_GameControllerPath SDL_GameControllerPath_REAL #define SDL_GameControllerPath SDL_GameControllerPath_REAL
#define SDL_JoystickPathForIndex SDL_JoystickPathForIndex_REAL #define SDL_GetJoystickPathForIndex SDL_GetJoystickPathForIndex_REAL
#define SDL_JoystickPath SDL_JoystickPath_REAL #define SDL_GetJoystickPath SDL_GetJoystickPath_REAL
#define SDL_JoystickAttachVirtualEx SDL_JoystickAttachVirtualEx_REAL #define SDL_AttachVirtualJoystickEx SDL_AttachVirtualJoystickEx_REAL
#define SDL_GameControllerGetFirmwareVersion SDL_GameControllerGetFirmwareVersion_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_GUIDToString SDL_GUIDToString_REAL
#define SDL_GUIDFromString SDL_GUIDFromString_REAL #define SDL_GUIDFromString SDL_GUIDFromString_REAL
#define SDL_HasLSX SDL_HasLSX_REAL #define SDL_HasLSX SDL_HasLSX_REAL

View File

@ -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_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_DelHintCallback,(const char *a, SDL_HintCallback b, void *c),(a,b,c),)
SDL_DYNAPI_PROC(void,SDL_ClearHints,(void),(),) SDL_DYNAPI_PROC(void,SDL_ClearHints,(void),(),)
SDL_DYNAPI_PROC(int,SDL_NumJoysticks,(void),(),return) SDL_DYNAPI_PROC(int,SDL_GetNumJoysticks,(void),(),return)
SDL_DYNAPI_PROC(const char*,SDL_JoystickNameForIndex,(int a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetJoystickNameForIndex,(int a),(a),return)
SDL_DYNAPI_PROC(SDL_Joystick*,SDL_JoystickOpen,(int a),(a),return) SDL_DYNAPI_PROC(SDL_Joystick*,SDL_OpenJoystick,(int a),(a),return)
SDL_DYNAPI_PROC(const char*,SDL_JoystickName,(SDL_Joystick *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetJoystickName,(SDL_Joystick *a),(a),return)
SDL_DYNAPI_PROC(SDL_JoystickGUID,SDL_JoystickGetDeviceGUID,(int a),(a),return) SDL_DYNAPI_PROC(SDL_JoystickGUID,SDL_GetJoystickDeviceGUID,(int a),(a),return)
SDL_DYNAPI_PROC(SDL_JoystickGUID,SDL_JoystickGetGUID,(SDL_Joystick *a),(a),return) SDL_DYNAPI_PROC(SDL_JoystickGUID,SDL_GetJoystickGUID,(SDL_Joystick *a),(a),return)
SDL_DYNAPI_PROC(void,SDL_JoystickGetGUIDString,(SDL_JoystickGUID a, char *b, int c),(a,b,c),) SDL_DYNAPI_PROC(void,SDL_GetJoystickGUIDString,(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_JoystickGUID,SDL_GetJoystickGUIDFromString,(const char *a),(a),return)
SDL_DYNAPI_PROC(SDL_bool,SDL_JoystickGetAttached,(SDL_Joystick *a),(a),return) SDL_DYNAPI_PROC(SDL_bool,SDL_IsJoystickConnected,(SDL_Joystick *a),(a),return)
SDL_DYNAPI_PROC(SDL_JoystickID,SDL_JoystickInstanceID,(SDL_Joystick *a),(a),return) SDL_DYNAPI_PROC(SDL_JoystickID,SDL_GetJoystickInstanceID,(SDL_Joystick *a),(a),return)
SDL_DYNAPI_PROC(int,SDL_JoystickNumAxes,(SDL_Joystick *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetNumJoystickAxes,(SDL_Joystick *a),(a),return)
SDL_DYNAPI_PROC(int,SDL_JoystickNumHats,(SDL_Joystick *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetNumJoystickHats,(SDL_Joystick *a),(a),return)
SDL_DYNAPI_PROC(int,SDL_JoystickNumButtons,(SDL_Joystick *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetNumJoystickButtons,(SDL_Joystick *a),(a),return)
SDL_DYNAPI_PROC(void,SDL_JoystickUpdate,(void),(),) SDL_DYNAPI_PROC(void,SDL_UpdateJoysticks,(void),(),)
SDL_DYNAPI_PROC(int,SDL_JoystickEventState,(int a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetJoystickEventState,(int a),(a),return)
SDL_DYNAPI_PROC(Sint16,SDL_JoystickGetAxis,(SDL_Joystick *a, int b),(a,b),return) SDL_DYNAPI_PROC(Sint16,SDL_GetJoystickAxis,(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_GetJoystickHat,(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(Uint8,SDL_GetJoystickButton,(SDL_Joystick *a, int b),(a,b),return)
SDL_DYNAPI_PROC(void,SDL_JoystickClose,(SDL_Joystick *a),(a),) SDL_DYNAPI_PROC(void,SDL_CloseJoystick,(SDL_Joystick *a),(a),)
SDL_DYNAPI_PROC(SDL_Window*,SDL_GetKeyboardFocus,(void),(),return) SDL_DYNAPI_PROC(SDL_Window*,SDL_GetKeyboardFocus,(void),(),return)
SDL_DYNAPI_PROC(const Uint8*,SDL_GetKeyboardState,(int *a),(a),return) SDL_DYNAPI_PROC(const Uint8*,SDL_GetKeyboardState,(int *a),(a),return)
SDL_DYNAPI_PROC(SDL_Keymod,SDL_GetModState,(void),(),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),) SDL_DYNAPI_PROC(void,SDL_SetWindowsMessageHook,(SDL_WindowsMessageHook a, void *b),(a,b),)
#endif #endif
SDL_DYNAPI_PROC(int,SDL_GetDisplayDPI,(int a, float *b, float *c, float *d),(a,b,c,d),return) 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_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_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_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) 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_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_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(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_GetJoystickDeviceVendor,(int a),(a),return)
SDL_DYNAPI_PROC(Uint16,SDL_JoystickGetDeviceProduct,(int a),(a),return) SDL_DYNAPI_PROC(Uint16,SDL_GetJoystickDeviceProduct,(int a),(a),return)
SDL_DYNAPI_PROC(Uint16,SDL_JoystickGetDeviceProductVersion,(int a),(a),return) SDL_DYNAPI_PROC(Uint16,SDL_GetJoystickDeviceProductVersion,(int a),(a),return)
SDL_DYNAPI_PROC(Uint16,SDL_JoystickGetVendor,(SDL_Joystick *a),(a),return) SDL_DYNAPI_PROC(Uint16,SDL_GetJoystickVendor,(SDL_Joystick *a),(a),return)
SDL_DYNAPI_PROC(Uint16,SDL_JoystickGetProduct,(SDL_Joystick *a),(a),return) SDL_DYNAPI_PROC(Uint16,SDL_GetJoystickProduct,(SDL_Joystick *a),(a),return)
SDL_DYNAPI_PROC(Uint16,SDL_JoystickGetProductVersion,(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_GameControllerGetVendor,(SDL_GameController *a),(a),return)
SDL_DYNAPI_PROC(Uint16,SDL_GameControllerGetProduct,(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(Uint16,SDL_GameControllerGetProductVersion,(SDL_GameController *a),(a),return)
SDL_DYNAPI_PROC(SDL_bool,SDL_HasNEON,(void),(),return) SDL_DYNAPI_PROC(SDL_bool,SDL_HasNEON,(void),(),return)
SDL_DYNAPI_PROC(int,SDL_GameControllerNumMappings,(void),(),return) SDL_DYNAPI_PROC(int,SDL_GameControllerNumMappings,(void),(),return)
SDL_DYNAPI_PROC(char*,SDL_GameControllerMappingForIndex,(int a),(a),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_bool,SDL_GetJoystickAxisInitialState,(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_GetJoystickDeviceType,(int a),(a),return)
SDL_DYNAPI_PROC(SDL_JoystickType,SDL_JoystickGetType,(SDL_Joystick *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_MemoryBarrierReleaseFunction,(void),(),)
SDL_DYNAPI_PROC(void,SDL_MemoryBarrierAcquireFunction,(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(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(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) 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(float,SDL_expf,(float a),(a),return)
SDL_DYNAPI_PROC(wchar_t*,SDL_wcsdup,(const wchar_t *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_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(int,SDL_NumSensors,(void),(),return)
SDL_DYNAPI_PROC(const char*,SDL_SensorGetDeviceName,(int a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_SensorGetDeviceName,(int a),(a),return)
SDL_DYNAPI_PROC(SDL_SensorType,SDL_SensorGetDeviceType,(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) 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 #endif
SDL_DYNAPI_PROC(int,SDL_JoystickGetDevicePlayerIndex,(int a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetJoystickDevicePlayerIndex,(int a),(a),return)
SDL_DYNAPI_PROC(int,SDL_JoystickGetPlayerIndex,(SDL_Joystick *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_GameControllerGetPlayerIndex,(SDL_GameController *a),(a),return)
SDL_DYNAPI_PROC(int,SDL_RenderFlush,(SDL_Renderer *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) 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_GameControllerType,SDL_GameControllerGetType,(SDL_GameController *a),(a),return)
SDL_DYNAPI_PROC(SDL_GameController*,SDL_GameControllerFromPlayerIndex,(int 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(void,SDL_GameControllerSetPlayerIndex,(SDL_GameController *a, int b),(a,b),)
SDL_DYNAPI_PROC(SDL_Joystick*,SDL_JoystickFromPlayerIndex,(int a),(a),return) SDL_DYNAPI_PROC(SDL_Joystick*,SDL_GetJoystickFromPlayerIndex,(int a),(a),return)
SDL_DYNAPI_PROC(void,SDL_JoystickSetPlayerIndex,(SDL_Joystick *a, int b),(a,b),) 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_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(int,SDL_GetTextureScaleMode,(SDL_Texture *a, SDL_ScaleMode *b),(a,b),return)
SDL_DYNAPI_PROC(void,SDL_OnApplicationWillTerminate,(void),(),) SDL_DYNAPI_PROC(void,SDL_OnApplicationWillTerminate,(void),(),)
@ -775,12 +775,12 @@ SDL_DYNAPI_PROC(int,SDL_GetAndroidSDKVersion,(void),(),return)
#endif #endif
SDL_DYNAPI_PROC(int,SDL_isupper,(int a),(a),return) 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_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_AttachVirtualJoystick,(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(int,SDL_DetachVirtualJoystick,(int a),(a),return)
SDL_DYNAPI_PROC(SDL_bool,SDL_JoystickIsVirtual,(int a),(a),return) SDL_DYNAPI_PROC(SDL_bool,SDL_IsJoystickVirtual,(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_SetJoystickVirtualAxis,(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_SetJoystickVirtualButton,(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_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(char*,SDL_GetErrorMsg,(char *a, int b),(a,b),return)
SDL_DYNAPI_PROC(void,SDL_LockSensors,(void),(),) SDL_DYNAPI_PROC(void,SDL_LockSensors,(void),(),)
SDL_DYNAPI_PROC(void,SDL_UnlockSensors,(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(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(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(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_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_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(SDL_bool,SDL_GameControllerHasButton,(SDL_GameController *a, SDL_GameControllerButton b),(a,b),return)
SDL_DYNAPI_PROC(int,SDL_GameControllerGetNumTouchpads,(SDL_GameController *a),(a),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(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(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_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(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(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) 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(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_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_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(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(int,SDL_SetTextureUserData,(SDL_Texture *a, void *b),(a,b),return)
SDL_DYNAPI_PROC(void*,SDL_GetTextureUserData,(SDL_Texture *a),(a),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(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_GameControllerPathForIndex,(int a),(a),return)
SDL_DYNAPI_PROC(const char*,SDL_GameControllerPath,(SDL_GameController *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_GetJoystickPathForIndex,(int a),(a),return)
SDL_DYNAPI_PROC(const char*,SDL_JoystickPath,(SDL_Joystick *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetJoystickPath,(SDL_Joystick *a),(a),return)
SDL_DYNAPI_PROC(int,SDL_JoystickAttachVirtualEx,(const SDL_VirtualJoystickDesc *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_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(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_GUID,SDL_GUIDFromString,(const char *a),(a),return)
SDL_DYNAPI_PROC(SDL_bool,SDL_HasLSX,(void),(),return) SDL_DYNAPI_PROC(SDL_bool,SDL_HasLSX,(void),(),return)

View File

@ -102,7 +102,7 @@ static SDL_bool SDL_update_joysticks = SDL_TRUE;
static void SDL_CalculateShouldUpdateJoysticks(SDL_bool hint_value) static void SDL_CalculateShouldUpdateJoysticks(SDL_bool hint_value)
{ {
if (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; SDL_update_joysticks = SDL_TRUE;
} else { } else {
SDL_update_joysticks = SDL_FALSE; SDL_update_joysticks = SDL_FALSE;
@ -870,7 +870,7 @@ static void SDL_PumpEventsInternal(SDL_bool push_sentinel)
#if !SDL_JOYSTICK_DISABLED #if !SDL_JOYSTICK_DISABLED
/* Check for joystick state change */ /* Check for joystick state change */
if (SDL_update_joysticks) { if (SDL_update_joysticks) {
SDL_JoystickUpdate(); SDL_UpdateJoysticks();
} }
#endif #endif
@ -1001,7 +1001,7 @@ static SDL_bool SDL_events_need_polling()
need_polling = need_polling =
SDL_WasInit(SDL_INIT_JOYSTICK) && SDL_WasInit(SDL_INIT_JOYSTICK) &&
SDL_update_joysticks && SDL_update_joysticks &&
(SDL_NumJoysticks() > 0); (SDL_GetNumJoysticks() > 0);
#endif #endif
#if !SDL_SENSOR_DISABLED #if !SDL_SENSOR_DISABLED

View File

@ -297,9 +297,9 @@ static int SDL_DINPUT_HapticOpenFromDevice(SDL_Haptic *haptic, LPDIRECTINPUTDEVI
haptic->hwdata->is_joystick = is_joystick; haptic->hwdata->is_joystick = is_joystick;
/* !!! FIXME: opening a haptic device here first will make an attempt to /* !!! 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: 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: to work, and that's probably the common case. Still,
!!! FIXME: ideally, We need to unify the opening code. */ !!! FIXME: ideally, We need to unify the opening code. */

View File

@ -816,7 +816,7 @@ static ControllerMapping_t *SDL_PrivateGetControllerMappingForGUID(SDL_JoystickG
mapping = SDL_CreateMappingForRAWINPUTController(guid); mapping = SDL_CreateMappingForRAWINPUTController(guid);
} else if (SDL_IsJoystickWGI(guid)) { } else if (SDL_IsJoystickWGI(guid)) {
mapping = SDL_CreateMappingForWGIController(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 */ /* We'll pick up a robust mapping in VIRTUAL_JoystickGetGamepadMapping */
#ifdef __ANDROID__ #ifdef __ANDROID__
} else { } else {
@ -1443,13 +1443,13 @@ static ControllerMapping_t *SDL_PrivateGetControllerMapping(int device_index)
SDL_AssertJoysticksLocked(); SDL_AssertJoysticksLocked();
if ((device_index < 0) || (device_index >= SDL_NumJoysticks())) { if ((device_index < 0) || (device_index >= SDL_GetNumJoysticks())) {
SDL_SetError("There are %d joysticks available", SDL_NumJoysticks()); SDL_SetError("There are %d joysticks available", SDL_GetNumJoysticks());
return NULL; return NULL;
} }
name = SDL_JoystickNameForIndex(device_index); name = SDL_GetJoystickNameForIndex(device_index);
guid = SDL_JoystickGetDeviceGUID(device_index); guid = SDL_GetJoystickDeviceGUID(device_index);
mapping = SDL_PrivateGetControllerMappingForNameAndGUID(name, guid); mapping = SDL_PrivateGetControllerMappingForNameAndGUID(name, guid);
if (mapping == NULL) { if (mapping == NULL) {
SDL_GamepadMapping raw_map; SDL_GamepadMapping raw_map;
@ -1622,7 +1622,7 @@ static int SDL_PrivateGameControllerAddMapping(const char *mappingString, SDL_Co
} else if (!SDL_strcasecmp(pchGUID, "xinput")) { } else if (!SDL_strcasecmp(pchGUID, "xinput")) {
is_xinput_mapping = SDL_TRUE; is_xinput_mapping = SDL_TRUE;
} }
jGUID = SDL_JoystickGetGUIDFromString(pchGUID); jGUID = SDL_GetJoystickGUIDFromString(pchGUID);
SDL_free(pchGUID); SDL_free(pchGUID);
pControllerMapping = SDL_PrivateAddMappingForGUID(jGUID, mappingString, &existing, priority); pControllerMapping = SDL_PrivateAddMappingForGUID(jGUID, mappingString, &existing, priority);
@ -1693,7 +1693,7 @@ static char *CreateMappingString(ControllerMapping_t *mapping, SDL_JoystickGUID
SDL_AssertJoysticksLocked(); SDL_AssertJoysticksLocked();
SDL_JoystickGetGUIDString(guid, pchGUID, sizeof(pchGUID)); SDL_GetJoystickGUIDString(guid, pchGUID, sizeof(pchGUID));
/* allocate enough memory for GUID + ',' + name + ',' + mapping + \0 */ /* allocate enough memory for GUID + ',' + name + ',' + mapping + \0 */
needed = SDL_strlen(pchGUID) + 1 + SDL_strlen(mapping->name) + 1 + SDL_strlen(mapping->mapping) + 1; 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); SDL_AddEventWatch(SDL_GameControllerEventWatcher, NULL);
/* Send added events for controllers currently attached */ /* 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)) { if (SDL_IsGameController(i)) {
SDL_Event deviceevent; SDL_Event deviceevent;
deviceevent.type = SDL_CONTROLLERDEVICEADDED; deviceevent.type = SDL_CONTROLLERDEVICEADDED;
@ -1918,7 +1918,7 @@ const char *SDL_GameControllerNameForIndex(int joystick_index)
ControllerMapping_t *mapping = SDL_PrivateGetControllerMapping(joystick_index); ControllerMapping_t *mapping = SDL_PrivateGetControllerMapping(joystick_index);
if (mapping != NULL) { if (mapping != NULL) {
if (SDL_strcmp(mapping->name, "*") == 0) { if (SDL_strcmp(mapping->name, "*") == 0) {
retval = SDL_JoystickNameForIndex(joystick_index); retval = SDL_GetJoystickNameForIndex(joystick_index);
} else { } else {
retval = mapping->name; retval = mapping->name;
} }
@ -1940,7 +1940,7 @@ const char *SDL_GameControllerPathForIndex(int joystick_index)
{ {
ControllerMapping_t *mapping = SDL_PrivateGetControllerMapping(joystick_index); ControllerMapping_t *mapping = SDL_PrivateGetControllerMapping(joystick_index);
if (mapping != NULL) { if (mapping != NULL) {
retval = SDL_JoystickPathForIndex(joystick_index); retval = SDL_GetJoystickPathForIndex(joystick_index);
} }
} }
SDL_UnlockJoysticks(); SDL_UnlockJoysticks();
@ -1953,7 +1953,7 @@ const char *SDL_GameControllerPathForIndex(int joystick_index)
*/ */
SDL_GameControllerType SDL_GameControllerTypeForIndex(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; SDL_JoystickGUID guid;
char pchGUID[33]; char pchGUID[33];
size_t needed; size_t needed;
guid = SDL_JoystickGetDeviceGUID(joystick_index); guid = SDL_GetJoystickDeviceGUID(joystick_index);
SDL_JoystickGetGUIDString(guid, pchGUID, sizeof(pchGUID)); SDL_GetJoystickGUIDString(guid, pchGUID, sizeof(pchGUID));
/* allocate enough memory for GUID + ',' + name + ',' + mapping + \0 */ /* allocate enough memory for GUID + ',' + name + ',' + mapping + \0 */
needed = SDL_strlen(pchGUID) + 1 + SDL_strlen(mapping->name) + 1 + SDL_strlen(mapping->mapping) + 1; needed = SDL_strlen(pchGUID) + 1 + SDL_strlen(mapping->name) + 1 + SDL_strlen(mapping->mapping) + 1;
retval = (char *)SDL_malloc(needed); retval = (char *)SDL_malloc(needed);
@ -2138,7 +2138,7 @@ SDL_GameController *SDL_GameControllerOpen(int joystick_index)
gamecontrollerlist = SDL_gamecontrollers; gamecontrollerlist = SDL_gamecontrollers;
/* If the controller is already open, return it */ /* If the controller is already open, return it */
instance_id = SDL_JoystickGetDeviceInstanceID(joystick_index); instance_id = SDL_GetJoystickDeviceInstanceID(joystick_index);
while (gamecontrollerlist != NULL) { while (gamecontrollerlist != NULL) {
if (instance_id == gamecontrollerlist->joystick->instance_id) { if (instance_id == gamecontrollerlist->joystick->instance_id) {
gamecontroller = gamecontrollerlist; gamecontroller = gamecontrollerlist;
@ -2166,7 +2166,7 @@ SDL_GameController *SDL_GameControllerOpen(int joystick_index)
} }
gamecontroller->magic = &gamecontroller_magic; gamecontroller->magic = &gamecontroller_magic;
gamecontroller->joystick = SDL_JoystickOpen(joystick_index); gamecontroller->joystick = SDL_OpenJoystick(joystick_index);
if (gamecontroller->joystick == NULL) { if (gamecontroller->joystick == NULL) {
SDL_free(gamecontroller); SDL_free(gamecontroller);
SDL_UnlockJoysticks(); 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)); gamecontroller->last_match_axis = (SDL_ExtendedGameControllerBind **)SDL_calloc(gamecontroller->joystick->naxes, sizeof(*gamecontroller->last_match_axis));
if (!gamecontroller->last_match_axis) { if (!gamecontroller->last_match_axis) {
SDL_OutOfMemory(); SDL_OutOfMemory();
SDL_JoystickClose(gamecontroller->joystick); SDL_CloseJoystick(gamecontroller->joystick);
SDL_free(gamecontroller); SDL_free(gamecontroller);
SDL_UnlockJoysticks(); SDL_UnlockJoysticks();
return NULL; 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)); gamecontroller->last_hat_mask = (Uint8 *)SDL_calloc(gamecontroller->joystick->nhats, sizeof(*gamecontroller->last_hat_mask));
if (!gamecontroller->last_hat_mask) { if (!gamecontroller->last_hat_mask) {
SDL_OutOfMemory(); SDL_OutOfMemory();
SDL_JoystickClose(gamecontroller->joystick); SDL_CloseJoystick(gamecontroller->joystick);
SDL_free(gamecontroller->last_match_axis); SDL_free(gamecontroller->last_match_axis);
SDL_free(gamecontroller); SDL_free(gamecontroller);
SDL_UnlockJoysticks(); SDL_UnlockJoysticks();
@ -2214,7 +2214,7 @@ SDL_GameController *SDL_GameControllerOpen(int joystick_index)
void SDL_GameControllerUpdate(void) void SDL_GameControllerUpdate(void)
{ {
/* Just for API completeness; the joystick API does all the work. */ /* 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; SDL_bool valid_output_range;
if (binding->inputType == SDL_CONTROLLER_BINDTYPE_AXIS) { 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) { 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); valid_input_range = (value >= binding->input.axis.axis_min && value <= binding->input.axis.axis_max);
} else { } else {
@ -2271,12 +2271,12 @@ Sint16 SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, SDL_GameCon
value = 0; value = 0;
} }
} else if (binding->inputType == SDL_CONTROLLER_BINDTYPE_BUTTON) { } 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) { if (value == SDL_PRESSED) {
value = binding->output.axis.axis_max; value = binding->output.axis.axis_max;
} }
} else if (binding->inputType == SDL_CONTROLLER_BINDTYPE_HAT) { } 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) { if (hat_mask & binding->input.hat.hat_mask) {
value = binding->output.axis.axis_max; 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) { if (binding->inputType == SDL_CONTROLLER_BINDTYPE_AXIS) {
SDL_bool valid_input_range; 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; 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) { 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); 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) { } 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; break;
} else if (binding->inputType == SDL_CONTROLLER_BINDTYPE_HAT) { } 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; retval = (hat_mask & binding->input.hat.hat_mask) ? SDL_PRESSED : SDL_RELEASED;
break; break;
} }
@ -2614,7 +2614,7 @@ const char *SDL_GameControllerName(SDL_GameController *gamecontroller)
CHECK_GAMECONTROLLER_MAGIC(gamecontroller, NULL); CHECK_GAMECONTROLLER_MAGIC(gamecontroller, NULL);
if (SDL_strcmp(gamecontroller->name, "*") == 0) { if (SDL_strcmp(gamecontroller->name, "*") == 0) {
retval = SDL_JoystickName(gamecontroller->joystick); retval = SDL_GetJoystickName(gamecontroller->joystick);
} else { } else {
retval = gamecontroller->name; retval = gamecontroller->name;
} }
@ -2631,7 +2631,7 @@ const char *SDL_GameControllerPath(SDL_GameController *gamecontroller)
if (joystick == NULL) { if (joystick == NULL) {
return NULL; return NULL;
} }
return SDL_JoystickPath(joystick); return SDL_GetJoystickPath(joystick);
} }
SDL_GameControllerType SDL_GameControllerGetType(SDL_GameController *gamecontroller) SDL_GameControllerType SDL_GameControllerGetType(SDL_GameController *gamecontroller)
@ -2641,7 +2641,7 @@ SDL_GameControllerType SDL_GameControllerGetType(SDL_GameController *gamecontrol
if (joystick == NULL) { if (joystick == NULL) {
return SDL_CONTROLLER_TYPE_UNKNOWN; 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) int SDL_GameControllerGetPlayerIndex(SDL_GameController *gamecontroller)
@ -2651,7 +2651,7 @@ int SDL_GameControllerGetPlayerIndex(SDL_GameController *gamecontroller)
if (joystick == NULL) { if (joystick == NULL) {
return -1; 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) { if (joystick == NULL) {
return; return;
} }
SDL_JoystickSetPlayerIndex(joystick, player_index); SDL_SetJoystickPlayerIndex(joystick, player_index);
} }
Uint16 SDL_GameControllerGetVendor(SDL_GameController *gamecontroller) Uint16 SDL_GameControllerGetVendor(SDL_GameController *gamecontroller)
@ -2674,7 +2674,7 @@ Uint16 SDL_GameControllerGetVendor(SDL_GameController *gamecontroller)
if (joystick == NULL) { if (joystick == NULL) {
return 0; return 0;
} }
return SDL_JoystickGetVendor(joystick); return SDL_GetJoystickVendor(joystick);
} }
Uint16 SDL_GameControllerGetProduct(SDL_GameController *gamecontroller) Uint16 SDL_GameControllerGetProduct(SDL_GameController *gamecontroller)
@ -2684,7 +2684,7 @@ Uint16 SDL_GameControllerGetProduct(SDL_GameController *gamecontroller)
if (joystick == NULL) { if (joystick == NULL) {
return 0; return 0;
} }
return SDL_JoystickGetProduct(joystick); return SDL_GetJoystickProduct(joystick);
} }
Uint16 SDL_GameControllerGetProductVersion(SDL_GameController *gamecontroller) Uint16 SDL_GameControllerGetProductVersion(SDL_GameController *gamecontroller)
@ -2694,7 +2694,7 @@ Uint16 SDL_GameControllerGetProductVersion(SDL_GameController *gamecontroller)
if (joystick == NULL) { if (joystick == NULL) {
return 0; return 0;
} }
return SDL_JoystickGetProductVersion(joystick); return SDL_GetJoystickProductVersion(joystick);
} }
Uint16 SDL_GameControllerGetFirmwareVersion(SDL_GameController *gamecontroller) Uint16 SDL_GameControllerGetFirmwareVersion(SDL_GameController *gamecontroller)
@ -2704,7 +2704,7 @@ Uint16 SDL_GameControllerGetFirmwareVersion(SDL_GameController *gamecontroller)
if (joystick == NULL) { if (joystick == NULL) {
return 0; return 0;
} }
return SDL_JoystickGetFirmwareVersion(joystick); return SDL_GetJoystickFirmwareVersion(joystick);
} }
const char * SDL_GameControllerGetSerial(SDL_GameController *gamecontroller) const char * SDL_GameControllerGetSerial(SDL_GameController *gamecontroller)
@ -2714,7 +2714,7 @@ const char * SDL_GameControllerGetSerial(SDL_GameController *gamecontroller)
if (joystick == NULL) { if (joystick == NULL) {
return 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) { if (joystick == NULL) {
return SDL_FALSE; 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_LockJoysticks();
{ {
SDL_Joystick *joystick = SDL_JoystickFromPlayerIndex(player_index); SDL_Joystick *joystick = SDL_GetJoystickFromPlayerIndex(player_index);
if (joystick) { if (joystick) {
retval = SDL_GameControllerFromInstanceID(joystick->instance_id); retval = SDL_GameControllerFromInstanceID(joystick->instance_id);
} }
@ -2870,7 +2870,7 @@ int SDL_GameControllerRumble(SDL_GameController *gamecontroller, Uint16 low_freq
if (joystick == NULL) { if (joystick == NULL) {
return -1; 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) 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) { if (joystick == NULL) {
return -1; 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) SDL_bool SDL_GameControllerHasLED(SDL_GameController *gamecontroller)
@ -2920,7 +2920,7 @@ int SDL_GameControllerSetLED(SDL_GameController *gamecontroller, Uint8 red, Uint
if (joystick == NULL) { if (joystick == NULL) {
return -1; 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) 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) { if (joystick == NULL) {
return -1; return -1;
} }
return SDL_JoystickSendEffect(joystick, data, size); return SDL_SendJoystickEffect(joystick, data, size);
} }
void SDL_GameControllerClose(SDL_GameController *gamecontroller) void SDL_GameControllerClose(SDL_GameController *gamecontroller)
@ -2950,7 +2950,7 @@ void SDL_GameControllerClose(SDL_GameController *gamecontroller)
return; return;
} }
SDL_JoystickClose(gamecontroller->joystick); SDL_CloseJoystick(gamecontroller->joystick);
gamecontrollerlist = SDL_gamecontrollers; gamecontrollerlist = SDL_gamecontrollers;
gamecontrollerlistprev = NULL; gamecontrollerlistprev = NULL;

View File

@ -333,7 +333,7 @@ int SDL_JoystickInit(void)
/* /*
* Count the number of joysticks attached to the system * Count the number of joysticks attached to the system
*/ */
int SDL_NumJoysticks(void) int SDL_GetNumJoysticks(void)
{ {
int i, total_joysticks = 0; int i, total_joysticks = 0;
SDL_LockJoysticks(); SDL_LockJoysticks();
@ -356,7 +356,7 @@ SDL_JoystickID SDL_GetNextJoystickInstanceID()
/* /*
* Get the implementation dependent name of a joystick * Get the implementation dependent name of a joystick
*/ */
const char *SDL_JoystickNameForIndex(int device_index) const char *SDL_GetJoystickNameForIndex(int device_index)
{ {
SDL_JoystickDriver *driver; SDL_JoystickDriver *driver;
const char *name = NULL; const char *name = NULL;
@ -374,7 +374,7 @@ const char *SDL_JoystickNameForIndex(int device_index)
/* /*
* Get the implementation dependent path of a joystick * Get the implementation dependent path of a joystick
*/ */
const char *SDL_JoystickPathForIndex(int device_index) const char *SDL_GetJoystickPathForIndex(int device_index)
{ {
SDL_JoystickDriver *driver; SDL_JoystickDriver *driver;
const char *path = NULL; const char *path = NULL;
@ -395,12 +395,12 @@ const char *SDL_JoystickPathForIndex(int device_index)
/* /*
* Get the player index of a joystick, or -1 if it's not available * Get the player index of a joystick, or -1 if it's not available
*/ */
int SDL_JoystickGetDevicePlayerIndex(int device_index) int SDL_GetJoystickDevicePlayerIndex(int device_index)
{ {
int player_index; int player_index;
SDL_LockJoysticks(); SDL_LockJoysticks();
player_index = SDL_GetPlayerIndexForJoystickID(SDL_JoystickGetDeviceInstanceID(device_index)); player_index = SDL_GetPlayerIndexForJoystickID(SDL_GetJoystickDeviceInstanceID(device_index));
SDL_UnlockJoysticks(); SDL_UnlockJoysticks();
return player_index; return player_index;
@ -423,8 +423,8 @@ static SDL_bool SDL_JoystickAxesCenteredAtZero(SDL_Joystick *joystick)
SDL_bool retval = SDL_FALSE; SDL_bool retval = SDL_FALSE;
int i; int i;
Uint32 id = MAKE_VIDPID(SDL_JoystickGetVendor(joystick), Uint32 id = MAKE_VIDPID(SDL_GetJoystickVendor(joystick),
SDL_JoystickGetProduct(joystick)); SDL_GetJoystickProduct(joystick));
/*printf("JOYSTICK '%s' VID/PID 0x%.4x/0x%.4x AXES: %d\n", joystick->name, vendor, product, joystick->naxes);*/ /*printf("JOYSTICK '%s' VID/PID 0x%.4x/0x%.4x AXES: %d\n", joystick->name, vendor, product, joystick->naxes);*/
@ -455,7 +455,7 @@ static SDL_bool SDL_JoystickAxesCenteredAtZero(SDL_Joystick *joystick)
* *
* This function returns a joystick identifier, or NULL if an error occurred. * This function returns a joystick identifier, or NULL if an error occurred.
*/ */
SDL_Joystick *SDL_JoystickOpen(int device_index) SDL_Joystick *SDL_OpenJoystick(int device_index)
{ {
SDL_JoystickDriver *driver; SDL_JoystickDriver *driver;
SDL_JoystickID instance_id; SDL_JoystickID instance_id;
@ -534,7 +534,7 @@ SDL_Joystick *SDL_JoystickOpen(int device_index)
} }
if (((joystick->naxes > 0) && !joystick->axes) || ((joystick->nhats > 0) && !joystick->hats) || ((joystick->nbuttons > 0) && !joystick->buttons)) { if (((joystick->naxes > 0) && !joystick->axes) || ((joystick->nhats > 0) && !joystick->hats) || ((joystick->nbuttons > 0) && !joystick->buttons)) {
SDL_OutOfMemory(); SDL_OutOfMemory();
SDL_JoystickClose(joystick); SDL_CloseJoystick(joystick);
SDL_UnlockJoysticks(); SDL_UnlockJoysticks();
return NULL; return NULL;
} }
@ -568,7 +568,7 @@ SDL_Joystick *SDL_JoystickOpen(int device_index)
return joystick; return joystick;
} }
int SDL_JoystickAttachVirtual(SDL_JoystickType type, int naxes, int nbuttons, int nhats) int SDL_AttachVirtualJoystick(SDL_JoystickType type, int naxes, int nbuttons, int nhats)
{ {
SDL_VirtualJoystickDesc desc; SDL_VirtualJoystickDesc desc;
@ -578,10 +578,10 @@ int SDL_JoystickAttachVirtual(SDL_JoystickType type, int naxes, int nbuttons, in
desc.naxes = (Uint16)naxes; desc.naxes = (Uint16)naxes;
desc.nbuttons = (Uint16)nbuttons; desc.nbuttons = (Uint16)nbuttons;
desc.nhats = (Uint16)nhats; desc.nhats = (Uint16)nhats;
return SDL_JoystickAttachVirtualEx(&desc); return SDL_AttachVirtualJoystickEx(&desc);
} }
int SDL_JoystickAttachVirtualEx(const SDL_VirtualJoystickDesc *desc) int SDL_AttachVirtualJoystickEx(const SDL_VirtualJoystickDesc *desc)
{ {
#if SDL_JOYSTICK_VIRTUAL #if SDL_JOYSTICK_VIRTUAL
int retval; int retval;
@ -595,7 +595,7 @@ int SDL_JoystickAttachVirtualEx(const SDL_VirtualJoystickDesc *desc)
#endif #endif
} }
int SDL_JoystickDetachVirtual(int device_index) int SDL_DetachVirtualJoystick(int device_index)
{ {
#if SDL_JOYSTICK_VIRTUAL #if SDL_JOYSTICK_VIRTUAL
SDL_JoystickDriver *driver; SDL_JoystickDriver *driver;
@ -616,7 +616,7 @@ int SDL_JoystickDetachVirtual(int device_index)
#endif #endif
} }
SDL_bool SDL_JoystickIsVirtual(int device_index) SDL_bool SDL_IsJoystickVirtual(int device_index)
{ {
#if SDL_JOYSTICK_VIRTUAL #if SDL_JOYSTICK_VIRTUAL
SDL_JoystickDriver *driver; SDL_JoystickDriver *driver;
@ -637,7 +637,7 @@ SDL_bool SDL_JoystickIsVirtual(int device_index)
#endif #endif
} }
int SDL_JoystickSetVirtualAxis(SDL_Joystick *joystick, int axis, Sint16 value) int SDL_SetJoystickVirtualAxis(SDL_Joystick *joystick, int axis, Sint16 value)
{ {
int retval; int retval;
@ -656,7 +656,7 @@ int SDL_JoystickSetVirtualAxis(SDL_Joystick *joystick, int axis, Sint16 value)
return retval; return retval;
} }
int SDL_JoystickSetVirtualButton(SDL_Joystick *joystick, int button, Uint8 value) int SDL_SetJoystickVirtualButton(SDL_Joystick *joystick, int button, Uint8 value)
{ {
int retval; int retval;
@ -675,7 +675,7 @@ int SDL_JoystickSetVirtualButton(SDL_Joystick *joystick, int button, Uint8 value
return retval; return retval;
} }
int SDL_JoystickSetVirtualHat(SDL_Joystick *joystick, int hat, Uint8 value) int SDL_SetJoystickVirtualHat(SDL_Joystick *joystick, int hat, Uint8 value)
{ {
int retval; int retval;
@ -720,7 +720,7 @@ SDL_bool SDL_PrivateJoystickGetAutoGamepadMapping(int device_index, SDL_GamepadM
/* /*
* Get the number of multi-dimensional axis controls on a joystick * Get the number of multi-dimensional axis controls on a joystick
*/ */
int SDL_JoystickNumAxes(SDL_Joystick *joystick) int SDL_GetNumJoystickAxes(SDL_Joystick *joystick)
{ {
int retval; int retval;
@ -738,7 +738,7 @@ int SDL_JoystickNumAxes(SDL_Joystick *joystick)
/* /*
* Get the number of hats on a joystick * Get the number of hats on a joystick
*/ */
int SDL_JoystickNumHats(SDL_Joystick *joystick) int SDL_GetNumJoystickHats(SDL_Joystick *joystick)
{ {
int retval; int retval;
@ -756,7 +756,7 @@ int SDL_JoystickNumHats(SDL_Joystick *joystick)
/* /*
* Get the number of buttons on a joystick * Get the number of buttons on a joystick
*/ */
int SDL_JoystickNumButtons(SDL_Joystick *joystick) int SDL_GetNumJoystickButtons(SDL_Joystick *joystick)
{ {
int retval; int retval;
@ -774,7 +774,7 @@ int SDL_JoystickNumButtons(SDL_Joystick *joystick)
/* /*
* Get the current state of an axis control on a joystick * Get the current state of an axis control on a joystick
*/ */
Sint16 SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis) Sint16 SDL_GetJoystickAxis(SDL_Joystick *joystick, int axis)
{ {
Sint16 state; Sint16 state;
@ -797,7 +797,7 @@ Sint16 SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis)
/* /*
* Get the initial state of an axis control on a joystick * Get the initial state of an axis control on a joystick
*/ */
SDL_bool SDL_JoystickGetAxisInitialState(SDL_Joystick *joystick, int axis, Sint16 *state) SDL_bool SDL_GetJoystickAxisInitialState(SDL_Joystick *joystick, int axis, Sint16 *state)
{ {
SDL_bool retval; SDL_bool retval;
@ -823,7 +823,7 @@ SDL_bool SDL_JoystickGetAxisInitialState(SDL_Joystick *joystick, int axis, Sint1
/* /*
* Get the current state of a hat on a joystick * Get the current state of a hat on a joystick
*/ */
Uint8 SDL_JoystickGetHat(SDL_Joystick *joystick, int hat) Uint8 SDL_GetJoystickHat(SDL_Joystick *joystick, int hat)
{ {
Uint8 state; Uint8 state;
@ -846,7 +846,7 @@ Uint8 SDL_JoystickGetHat(SDL_Joystick *joystick, int hat)
/* /*
* Get the current state of a button on a joystick * Get the current state of a button on a joystick
*/ */
Uint8 SDL_JoystickGetButton(SDL_Joystick *joystick, int button) Uint8 SDL_GetJoystickButton(SDL_Joystick *joystick, int button)
{ {
Uint8 state; Uint8 state;
@ -870,7 +870,7 @@ Uint8 SDL_JoystickGetButton(SDL_Joystick *joystick, int button)
* Return if the joystick in question is currently attached to the system, * Return if the joystick in question is currently attached to the system,
* \return SDL_FALSE if not plugged in, SDL_TRUE if still present. * \return SDL_FALSE if not plugged in, SDL_TRUE if still present.
*/ */
SDL_bool SDL_JoystickGetAttached(SDL_Joystick *joystick) SDL_bool SDL_IsJoystickConnected(SDL_Joystick *joystick)
{ {
SDL_bool retval; SDL_bool retval;
@ -888,7 +888,7 @@ SDL_bool SDL_JoystickGetAttached(SDL_Joystick *joystick)
/* /*
* Get the instance id for this opened joystick * Get the instance id for this opened joystick
*/ */
SDL_JoystickID SDL_JoystickInstanceID(SDL_Joystick *joystick) SDL_JoystickID SDL_GetJoystickInstanceID(SDL_Joystick *joystick)
{ {
SDL_JoystickID retval; SDL_JoystickID retval;
@ -906,7 +906,7 @@ SDL_JoystickID SDL_JoystickInstanceID(SDL_Joystick *joystick)
/* /*
* Return the SDL_Joystick associated with an instance id. * Return the SDL_Joystick associated with an instance id.
*/ */
SDL_Joystick *SDL_JoystickFromInstanceID(SDL_JoystickID instance_id) SDL_Joystick *SDL_GetJoystickFromInstanceID(SDL_JoystickID instance_id)
{ {
SDL_Joystick *joystick; SDL_Joystick *joystick;
@ -923,7 +923,7 @@ SDL_Joystick *SDL_JoystickFromInstanceID(SDL_JoystickID instance_id)
/** /**
* Return the SDL_Joystick associated with a player index. * Return the SDL_Joystick associated with a player index.
*/ */
SDL_Joystick *SDL_JoystickFromPlayerIndex(int player_index) SDL_Joystick *SDL_GetJoystickFromPlayerIndex(int player_index)
{ {
SDL_JoystickID instance_id; SDL_JoystickID instance_id;
SDL_Joystick *joystick; SDL_Joystick *joystick;
@ -942,7 +942,7 @@ SDL_Joystick *SDL_JoystickFromPlayerIndex(int player_index)
/* /*
* Get the friendly name of this joystick * Get the friendly name of this joystick
*/ */
const char *SDL_JoystickName(SDL_Joystick *joystick) const char *SDL_GetJoystickName(SDL_Joystick *joystick)
{ {
const char *retval; const char *retval;
@ -960,7 +960,7 @@ const char *SDL_JoystickName(SDL_Joystick *joystick)
/* /*
* Get the implementation dependent path of this joystick * Get the implementation dependent path of this joystick
*/ */
const char *SDL_JoystickPath(SDL_Joystick *joystick) const char *SDL_GetJoystickPath(SDL_Joystick *joystick)
{ {
const char *retval; const char *retval;
@ -983,7 +983,7 @@ const char *SDL_JoystickPath(SDL_Joystick *joystick)
/** /**
* Get the player index of an opened joystick, or -1 if it's not available * Get the player index of an opened joystick, or -1 if it's not available
*/ */
int SDL_JoystickGetPlayerIndex(SDL_Joystick *joystick) int SDL_GetJoystickPlayerIndex(SDL_Joystick *joystick)
{ {
int retval; int retval;
@ -1001,7 +1001,7 @@ int SDL_JoystickGetPlayerIndex(SDL_Joystick *joystick)
/** /**
* Set the player index of an opened joystick * Set the player index of an opened joystick
*/ */
void SDL_JoystickSetPlayerIndex(SDL_Joystick *joystick, int player_index) void SDL_SetJoystickPlayerIndex(SDL_Joystick *joystick, int player_index)
{ {
SDL_LockJoysticks(); SDL_LockJoysticks();
{ {
@ -1012,7 +1012,7 @@ void SDL_JoystickSetPlayerIndex(SDL_Joystick *joystick, int player_index)
SDL_UnlockJoysticks(); SDL_UnlockJoysticks();
} }
int SDL_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms) int SDL_RumbleJoystick(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms)
{ {
int retval; int retval;
@ -1049,7 +1049,7 @@ int SDL_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint
return retval; return retval;
} }
int SDL_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms) int SDL_RumbleJoystickTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms)
{ {
int retval; int retval;
@ -1125,7 +1125,7 @@ SDL_bool SDL_JoystickHasRumbleTriggers(SDL_Joystick *joystick)
return retval; return retval;
} }
int SDL_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) int SDL_SetJoystickLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue)
{ {
int retval; int retval;
SDL_bool isfreshvalue; SDL_bool isfreshvalue;
@ -1156,7 +1156,7 @@ int SDL_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blu
return retval; return retval;
} }
int SDL_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size) int SDL_SendJoystickEffect(SDL_Joystick *joystick, const void *data, int size)
{ {
int retval; int retval;
@ -1172,9 +1172,9 @@ int SDL_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size)
} }
/* /*
* Close a joystick previously opened with SDL_JoystickOpen() * Close a joystick previously opened with SDL_OpenJoystick()
*/ */
void SDL_JoystickClose(SDL_Joystick *joystick) void SDL_CloseJoystick(SDL_Joystick *joystick)
{ {
SDL_Joystick *joysticklist; SDL_Joystick *joysticklist;
SDL_Joystick *joysticklistprev; SDL_Joystick *joysticklistprev;
@ -1191,10 +1191,10 @@ void SDL_JoystickClose(SDL_Joystick *joystick)
} }
if (joystick->rumble_expiration) { if (joystick->rumble_expiration) {
SDL_JoystickRumble(joystick, 0, 0, 0); SDL_RumbleJoystick(joystick, 0, 0, 0);
} }
if (joystick->trigger_rumble_expiration) { if (joystick->trigger_rumble_expiration) {
SDL_JoystickRumbleTriggers(joystick, 0, 0, 0); SDL_RumbleJoystickTriggers(joystick, 0, 0, 0);
} }
joystick->driver->Close(joystick); joystick->driver->Close(joystick);
@ -1247,7 +1247,7 @@ void SDL_JoystickQuit(void)
/* Stop the event polling */ /* Stop the event polling */
while (SDL_joysticks) { while (SDL_joysticks) {
SDL_joysticks->ref_count = 1; SDL_joysticks->ref_count = 1;
SDL_JoystickClose(SDL_joysticks); SDL_CloseJoystick(SDL_joysticks);
} }
/* Quit drivers in reverse order to avoid breaking dependencies between drivers */ /* Quit drivers in reverse order to avoid breaking dependencies between drivers */
@ -1541,7 +1541,7 @@ int SDL_PrivateJoystickAxis(Uint64 timestamp, SDL_Joystick *joystick, Uint8 axis
/* Make sure we don't send motion until there's real activity on this axis */ /* Make sure we don't send motion until there's real activity on this axis */
const int MAX_ALLOWED_JITTER = SDL_JOYSTICK_AXIS_MAX / 80; /* ShanWan PS3 controller needed 96 */ const int MAX_ALLOWED_JITTER = SDL_JOYSTICK_AXIS_MAX / 80; /* ShanWan PS3 controller needed 96 */
if (SDL_abs(value - info->value) <= MAX_ALLOWED_JITTER && if (SDL_abs(value - info->value) <= MAX_ALLOWED_JITTER &&
!SDL_IsJoystickVirtual(joystick->guid)) { !SDL_IsJoystickVIRTUAL(joystick->guid)) {
return 0; return 0;
} }
info->sent_initial_value = SDL_TRUE; info->sent_initial_value = SDL_TRUE;
@ -1678,7 +1678,7 @@ int SDL_PrivateJoystickButton(Uint64 timestamp, SDL_Joystick *joystick, Uint8 bu
return posted; return posted;
} }
void SDL_JoystickUpdate(void) void SDL_UpdateJoysticks(void)
{ {
int i; int i;
Uint64 now; Uint64 now;
@ -1706,7 +1706,7 @@ void SDL_JoystickUpdate(void)
now = SDL_GetTicks(); now = SDL_GetTicks();
if (joystick->rumble_expiration && now >= joystick->rumble_expiration) { if (joystick->rumble_expiration && now >= joystick->rumble_expiration) {
SDL_JoystickRumble(joystick, 0, 0, 0); SDL_RumbleJoystick(joystick, 0, 0, 0);
joystick->rumble_resend = 0; joystick->rumble_resend = 0;
} }
@ -1719,7 +1719,7 @@ void SDL_JoystickUpdate(void)
} }
if (joystick->trigger_rumble_expiration && now >= joystick->trigger_rumble_expiration) { if (joystick->trigger_rumble_expiration && now >= joystick->trigger_rumble_expiration) {
SDL_JoystickRumbleTriggers(joystick, 0, 0, 0); SDL_RumbleJoystickTriggers(joystick, 0, 0, 0);
} }
} }
@ -1733,7 +1733,7 @@ void SDL_JoystickUpdate(void)
SDL_UnlockJoysticks(); SDL_UnlockJoysticks();
} }
int SDL_JoystickEventState(int state) int SDL_GetJoystickEventState(int state)
{ {
#if SDL_EVENTS_DISABLED #if SDL_EVENTS_DISABLED
return SDL_DISABLE; return SDL_DISABLE;
@ -2157,7 +2157,7 @@ SDL_GameControllerType SDL_GetJoystickGameControllerTypeFromGUID(SDL_JoystickGUI
/* This is probably an Xbox One controller */ /* This is probably an Xbox One controller */
return SDL_CONTROLLER_TYPE_XBOXONE; return SDL_CONTROLLER_TYPE_XBOXONE;
} }
if (SDL_IsJoystickVirtual(guid)) { if (SDL_IsJoystickVIRTUAL(guid)) {
return SDL_CONTROLLER_TYPE_VIRTUAL; return SDL_CONTROLLER_TYPE_VIRTUAL;
} }
#ifdef SDL_JOYSTICK_HIDAPI #ifdef SDL_JOYSTICK_HIDAPI
@ -2329,7 +2329,7 @@ SDL_bool SDL_IsJoystickRAWINPUT(SDL_JoystickGUID guid)
return (guid.data[14] == 'r') ? SDL_TRUE : SDL_FALSE; return (guid.data[14] == 'r') ? SDL_TRUE : SDL_FALSE;
} }
SDL_bool SDL_IsJoystickVirtual(SDL_JoystickGUID guid) SDL_bool SDL_IsJoystickVIRTUAL(SDL_JoystickGUID guid)
{ {
return (guid.data[14] == 'v') ? SDL_TRUE : SDL_FALSE; return (guid.data[14] == 'v') ? SDL_TRUE : SDL_FALSE;
} }
@ -2492,7 +2492,7 @@ static SDL_JoystickType SDL_GetJoystickGUIDType(SDL_JoystickGUID guid)
return (SDL_JoystickType)guid.data[15]; return (SDL_JoystickType)guid.data[15];
} }
if (SDL_IsJoystickVirtual(guid)) { if (SDL_IsJoystickVIRTUAL(guid)) {
return (SDL_JoystickType)guid.data[15]; return (SDL_JoystickType)guid.data[15];
} }
@ -2682,7 +2682,7 @@ SDL_bool SDL_ShouldIgnoreJoystick(const char *name, SDL_JoystickGUID guid)
} }
/* return the guid for this index */ /* return the guid for this index */
SDL_JoystickGUID SDL_JoystickGetDeviceGUID(int device_index) SDL_JoystickGUID SDL_GetJoystickDeviceGUID(int device_index)
{ {
SDL_JoystickDriver *driver; SDL_JoystickDriver *driver;
SDL_JoystickGUID guid; SDL_JoystickGUID guid;
@ -2698,37 +2698,37 @@ SDL_JoystickGUID SDL_JoystickGetDeviceGUID(int device_index)
return guid; return guid;
} }
Uint16 SDL_JoystickGetDeviceVendor(int device_index) Uint16 SDL_GetJoystickDeviceVendor(int device_index)
{ {
Uint16 vendor; Uint16 vendor;
SDL_JoystickGUID guid = SDL_JoystickGetDeviceGUID(device_index); SDL_JoystickGUID guid = SDL_GetJoystickDeviceGUID(device_index);
SDL_GetJoystickGUIDInfo(guid, &vendor, NULL, NULL, NULL); SDL_GetJoystickGUIDInfo(guid, &vendor, NULL, NULL, NULL);
return vendor; return vendor;
} }
Uint16 SDL_JoystickGetDeviceProduct(int device_index) Uint16 SDL_GetJoystickDeviceProduct(int device_index)
{ {
Uint16 product; Uint16 product;
SDL_JoystickGUID guid = SDL_JoystickGetDeviceGUID(device_index); SDL_JoystickGUID guid = SDL_GetJoystickDeviceGUID(device_index);
SDL_GetJoystickGUIDInfo(guid, NULL, &product, NULL, NULL); SDL_GetJoystickGUIDInfo(guid, NULL, &product, NULL, NULL);
return product; return product;
} }
Uint16 SDL_JoystickGetDeviceProductVersion(int device_index) Uint16 SDL_GetJoystickDeviceProductVersion(int device_index)
{ {
Uint16 version; Uint16 version;
SDL_JoystickGUID guid = SDL_JoystickGetDeviceGUID(device_index); SDL_JoystickGUID guid = SDL_GetJoystickDeviceGUID(device_index);
SDL_GetJoystickGUIDInfo(guid, NULL, NULL, &version, NULL); SDL_GetJoystickGUIDInfo(guid, NULL, NULL, &version, NULL);
return version; return version;
} }
SDL_JoystickType SDL_JoystickGetDeviceType(int device_index) SDL_JoystickType SDL_GetJoystickDeviceType(int device_index)
{ {
SDL_JoystickType type; SDL_JoystickType type;
SDL_JoystickGUID guid = SDL_JoystickGetDeviceGUID(device_index); SDL_JoystickGUID guid = SDL_GetJoystickDeviceGUID(device_index);
type = SDL_GetJoystickGUIDType(guid); type = SDL_GetJoystickGUIDType(guid);
if (type == SDL_JOYSTICK_TYPE_UNKNOWN) { if (type == SDL_JOYSTICK_TYPE_UNKNOWN) {
@ -2739,7 +2739,7 @@ SDL_JoystickType SDL_JoystickGetDeviceType(int device_index)
return type; return type;
} }
SDL_JoystickID SDL_JoystickGetDeviceInstanceID(int device_index) SDL_JoystickID SDL_GetJoystickDeviceInstanceID(int device_index)
{ {
SDL_JoystickDriver *driver; SDL_JoystickDriver *driver;
SDL_JoystickID instance_id = -1; SDL_JoystickID instance_id = -1;
@ -2758,9 +2758,9 @@ int SDL_JoystickGetDeviceIndexFromInstanceID(SDL_JoystickID instance_id)
int i, num_joysticks, device_index = -1; int i, num_joysticks, device_index = -1;
SDL_LockJoysticks(); SDL_LockJoysticks();
num_joysticks = SDL_NumJoysticks(); num_joysticks = SDL_GetNumJoysticks();
for (i = 0; i < num_joysticks; ++i) { for (i = 0; i < num_joysticks; ++i) {
if (SDL_JoystickGetDeviceInstanceID(i) == instance_id) { if (SDL_GetJoystickDeviceInstanceID(i) == instance_id) {
device_index = i; device_index = i;
break; break;
} }
@ -2770,7 +2770,7 @@ int SDL_JoystickGetDeviceIndexFromInstanceID(SDL_JoystickID instance_id)
return device_index; return device_index;
} }
SDL_JoystickGUID SDL_JoystickGetGUID(SDL_Joystick *joystick) SDL_JoystickGUID SDL_GetJoystickGUID(SDL_Joystick *joystick)
{ {
SDL_JoystickGUID retval; SDL_JoystickGUID retval;
@ -2787,34 +2787,34 @@ SDL_JoystickGUID SDL_JoystickGetGUID(SDL_Joystick *joystick)
return retval; return retval;
} }
Uint16 SDL_JoystickGetVendor(SDL_Joystick *joystick) Uint16 SDL_GetJoystickVendor(SDL_Joystick *joystick)
{ {
Uint16 vendor; Uint16 vendor;
SDL_JoystickGUID guid = SDL_JoystickGetGUID(joystick); SDL_JoystickGUID guid = SDL_GetJoystickGUID(joystick);
SDL_GetJoystickGUIDInfo(guid, &vendor, NULL, NULL, NULL); SDL_GetJoystickGUIDInfo(guid, &vendor, NULL, NULL, NULL);
return vendor; return vendor;
} }
Uint16 SDL_JoystickGetProduct(SDL_Joystick *joystick) Uint16 SDL_GetJoystickProduct(SDL_Joystick *joystick)
{ {
Uint16 product; Uint16 product;
SDL_JoystickGUID guid = SDL_JoystickGetGUID(joystick); SDL_JoystickGUID guid = SDL_GetJoystickGUID(joystick);
SDL_GetJoystickGUIDInfo(guid, NULL, &product, NULL, NULL); SDL_GetJoystickGUIDInfo(guid, NULL, &product, NULL, NULL);
return product; return product;
} }
Uint16 SDL_JoystickGetProductVersion(SDL_Joystick *joystick) Uint16 SDL_GetJoystickProductVersion(SDL_Joystick *joystick)
{ {
Uint16 version; Uint16 version;
SDL_JoystickGUID guid = SDL_JoystickGetGUID(joystick); SDL_JoystickGUID guid = SDL_GetJoystickGUID(joystick);
SDL_GetJoystickGUIDInfo(guid, NULL, NULL, &version, NULL); SDL_GetJoystickGUIDInfo(guid, NULL, NULL, &version, NULL);
return version; return version;
} }
Uint16 SDL_JoystickGetFirmwareVersion(SDL_Joystick *joystick) Uint16 SDL_GetJoystickFirmwareVersion(SDL_Joystick *joystick)
{ {
Uint16 retval; Uint16 retval;
@ -2829,7 +2829,7 @@ Uint16 SDL_JoystickGetFirmwareVersion(SDL_Joystick *joystick)
return retval; return retval;
} }
const char *SDL_JoystickGetSerial(SDL_Joystick *joystick) const char *SDL_GetJoystickSerial(SDL_Joystick *joystick)
{ {
const char *retval; const char *retval;
@ -2844,10 +2844,10 @@ const char *SDL_JoystickGetSerial(SDL_Joystick *joystick)
return retval; return retval;
} }
SDL_JoystickType SDL_JoystickGetType(SDL_Joystick *joystick) SDL_JoystickType SDL_GetJoystickType(SDL_Joystick *joystick)
{ {
SDL_JoystickType type; SDL_JoystickType type;
SDL_JoystickGUID guid = SDL_JoystickGetGUID(joystick); SDL_JoystickGUID guid = SDL_GetJoystickGUID(joystick);
type = SDL_GetJoystickGUIDType(guid); type = SDL_GetJoystickGUIDType(guid);
if (type == SDL_JOYSTICK_TYPE_UNKNOWN) { if (type == SDL_JOYSTICK_TYPE_UNKNOWN) {
@ -2865,13 +2865,13 @@ SDL_JoystickType SDL_JoystickGetType(SDL_Joystick *joystick)
} }
/* convert the guid to a printable string */ /* convert the guid to a printable string */
void SDL_JoystickGetGUIDString(SDL_JoystickGUID guid, char *pszGUID, int cbGUID) void SDL_GetJoystickGUIDString(SDL_JoystickGUID guid, char *pszGUID, int cbGUID)
{ {
SDL_GUIDToString(guid, pszGUID, cbGUID); SDL_GUIDToString(guid, pszGUID, cbGUID);
} }
/* convert the string version of a joystick guid to the struct */ /* convert the string version of a joystick guid to the struct */
SDL_JoystickGUID SDL_JoystickGetGUIDFromString(const char *pchGUID) SDL_JoystickGUID SDL_GetJoystickGUIDFromString(const char *pchGUID)
{ {
return SDL_GUIDFromString(pchGUID); return SDL_GUIDFromString(pchGUID);
} }
@ -2898,7 +2898,7 @@ void SDL_PrivateJoystickBatteryLevel(SDL_Joystick *joystick, SDL_JoystickPowerLe
} }
/* return its power level */ /* return its power level */
SDL_JoystickPowerLevel SDL_JoystickCurrentPowerLevel(SDL_Joystick *joystick) SDL_JoystickPowerLevel SDL_GetJoystickPowerLevel(SDL_Joystick *joystick)
{ {
SDL_JoystickPowerLevel retval; SDL_JoystickPowerLevel retval;

View File

@ -132,7 +132,7 @@ extern SDL_bool SDL_IsJoystickHIDAPI(SDL_JoystickGUID guid);
extern SDL_bool SDL_IsJoystickRAWINPUT(SDL_JoystickGUID guid); extern SDL_bool SDL_IsJoystickRAWINPUT(SDL_JoystickGUID guid);
/* Function to return whether a joystick guid comes from the Virtual driver */ /* 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 */ /* Function to return whether a joystick should be ignored */
extern SDL_bool SDL_ShouldIgnoreJoystick(const char *name, SDL_JoystickGUID guid); extern SDL_bool SDL_ShouldIgnoreJoystick(const char *name, SDL_JoystickGUID guid);

View File

@ -244,7 +244,7 @@ static void HIDAPI_DriverGameCube_HandleJoystickPacket(SDL_HIDAPI_Device *device
return; /* How do we handle this packet? */ return; /* How do we handle this packet? */
} }
joystick = SDL_JoystickFromInstanceID(ctx->joysticks[i]); joystick = SDL_GetJoystickFromInstanceID(ctx->joysticks[i]);
if (joystick == NULL) { if (joystick == NULL) {
/* Hasn't been opened yet, skip */ /* Hasn't been opened yet, skip */
return; return;
@ -319,7 +319,7 @@ static void HIDAPI_DriverGameCube_HandleNintendoPacket(SDL_HIDAPI_Device *device
ResetAxisRange(ctx, i); ResetAxisRange(ctx, i);
HIDAPI_JoystickConnected(device, &ctx->joysticks[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 */ /* Hasn't been opened yet, skip */
if (joystick == NULL) { if (joystick == NULL) {

View File

@ -385,7 +385,7 @@ static SDL_bool HIDAPI_DriverLuna_UpdateDevice(SDL_HIDAPI_Device *device)
int size = 0; int size = 0;
if (device->num_joysticks > 0) { if (device->num_joysticks > 0) {
joystick = SDL_JoystickFromInstanceID(device->joysticks[0]); joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]);
} else { } else {
return SDL_FALSE; return SDL_FALSE;
} }

View File

@ -238,7 +238,7 @@ static SDL_bool HIDAPI_DriverPS3_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joy
SDL_zeroa(ctx->last_state); SDL_zeroa(ctx->last_state);
/* Initialize player index (needed for setting LEDs) */ /* Initialize player index (needed for setting LEDs) */
ctx->player_index = SDL_JoystickGetPlayerIndex(joystick); ctx->player_index = SDL_GetJoystickPlayerIndex(joystick);
/* Initialize the joystick capabilities */ /* Initialize the joystick capabilities */
joystick->nbuttons = 15; joystick->nbuttons = 15;
@ -482,7 +482,7 @@ static SDL_bool HIDAPI_DriverPS3_UpdateDevice(SDL_HIDAPI_Device *device)
int size; int size;
if (device->num_joysticks > 0) { if (device->num_joysticks > 0) {
joystick = SDL_JoystickFromInstanceID(device->joysticks[0]); joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]);
} else { } else {
return SDL_FALSE; return SDL_FALSE;
} }
@ -796,7 +796,7 @@ static SDL_bool HIDAPI_DriverPS3ThirdParty_UpdateDevice(SDL_HIDAPI_Device *devic
int size; int size;
if (device->num_joysticks > 0) { if (device->num_joysticks > 0) {
joystick = SDL_JoystickFromInstanceID(device->joysticks[0]); joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]);
} else { } else {
return SDL_FALSE; return SDL_FALSE;
} }

View File

@ -676,7 +676,7 @@ static SDL_bool HIDAPI_DriverPS4_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joy
SDL_zero(ctx->last_state); SDL_zero(ctx->last_state);
/* Initialize player index (needed for setting LEDs) */ /* Initialize player index (needed for setting LEDs) */
ctx->player_index = SDL_JoystickGetPlayerIndex(joystick); ctx->player_index = SDL_GetJoystickPlayerIndex(joystick);
/* Initialize the joystick capabilities */ /* Initialize the joystick capabilities */
joystick->nbuttons = ctx->touchpad_supported ? 16 : 15; 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(); Uint64 now = SDL_GetTicks();
if (device->num_joysticks > 0) { 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) { while ((size = SDL_hid_read_timeout(device->dev, data, sizeof(data), 0)) > 0) {

View File

@ -831,7 +831,7 @@ static SDL_bool HIDAPI_DriverPS5_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joy
SDL_zero(ctx->last_state); SDL_zero(ctx->last_state);
/* Initialize player index (needed for setting LEDs) */ /* 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); ctx->player_lights = SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED, SDL_TRUE);
/* Initialize the joystick capabilities */ /* Initialize the joystick capabilities */
@ -1331,7 +1331,7 @@ static SDL_bool HIDAPI_DriverPS5_UpdateDevice(SDL_HIDAPI_Device *device)
Uint64 now = SDL_GetTicks(); Uint64 now = SDL_GetTicks();
if (device->num_joysticks > 0) { 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) { while ((size = SDL_hid_read_timeout(device->dev, data, sizeof(data), 0)) > 0) {

View File

@ -477,7 +477,7 @@ static SDL_bool HIDAPI_DriverShield_UpdateDevice(SDL_HIDAPI_Device *device)
ShieldCommandReport_t *cmd_resp_report; ShieldCommandReport_t *cmd_resp_report;
if (device->num_joysticks > 0) { if (device->num_joysticks > 0) {
joystick = SDL_JoystickFromInstanceID(device->joysticks[0]); joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]);
} else { } else {
return SDL_FALSE; return SDL_FALSE;
} }

View File

@ -254,7 +254,7 @@ static SDL_bool HIDAPI_DriverStadia_UpdateDevice(SDL_HIDAPI_Device *device)
int size = 0; int size = 0;
if (device->num_joysticks > 0) { if (device->num_joysticks > 0) {
joystick = SDL_JoystickFromInstanceID(device->joysticks[0]); joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]);
} else { } else {
return SDL_FALSE; return SDL_FALSE;
} }

View File

@ -1092,7 +1092,7 @@ static SDL_bool HIDAPI_DriverSteam_UpdateDevice(SDL_HIDAPI_Device *device)
SDL_Joystick *joystick = NULL; SDL_Joystick *joystick = NULL;
if (device->num_joysticks > 0) { if (device->num_joysticks > 0) {
joystick = SDL_JoystickFromInstanceID(device->joysticks[0]); joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]);
} else { } else {
return SDL_FALSE; return SDL_FALSE;
} }

View File

@ -1356,7 +1356,7 @@ static SDL_bool HIDAPI_DriverSwitch_OpenJoystick(SDL_HIDAPI_Device *device, SDL_
} }
/* Initialize player index (needed for setting LEDs) */ /* 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); ctx->m_bPlayerLights = SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED, SDL_TRUE);
UpdateSlotLED(ctx); UpdateSlotLED(ctx);
@ -2081,7 +2081,7 @@ static SDL_bool HIDAPI_DriverSwitch_UpdateDevice(SDL_HIDAPI_Device *device)
Uint64 now = SDL_GetTicks(); Uint64 now = SDL_GetTicks();
if (device->num_joysticks > 0) { if (device->num_joysticks > 0) {
joystick = SDL_JoystickFromInstanceID(device->joysticks[0]); joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]);
} }
while ((size = ReadInput(ctx)) > 0) { while ((size = ReadInput(ctx)) > 0) {

View File

@ -790,7 +790,7 @@ static SDL_bool HIDAPI_DriverWii_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joy
SDL_GameControllerButtonReportingHintChanged, ctx); SDL_GameControllerButtonReportingHintChanged, ctx);
/* Initialize player index (needed for setting LEDs) */ /* 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); ctx->m_bPlayerLights = SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_WII_PLAYER_LED, SDL_TRUE);
UpdateSlotLED(ctx); UpdateSlotLED(ctx);
@ -1574,7 +1574,7 @@ static SDL_bool HIDAPI_DriverWii_UpdateDevice(SDL_HIDAPI_Device *device)
Uint64 now; Uint64 now;
if (device->num_joysticks > 0) { if (device->num_joysticks > 0) {
joystick = SDL_JoystickFromInstanceID(device->joysticks[0]); joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]);
} else { } else {
return SDL_FALSE; return SDL_FALSE;
} }

View File

@ -178,7 +178,7 @@ static SDL_bool HIDAPI_DriverXbox360_OpenJoystick(SDL_HIDAPI_Device *device, SDL
SDL_zeroa(ctx->last_state); SDL_zeroa(ctx->last_state);
/* Initialize player index (needed for setting LEDs) */ /* 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); ctx->player_lights = SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED, SDL_TRUE);
UpdateSlotLED(ctx); UpdateSlotLED(ctx);
@ -318,7 +318,7 @@ static SDL_bool HIDAPI_DriverXbox360_UpdateDevice(SDL_HIDAPI_Device *device)
int size = 0; int size = 0;
if (device->num_joysticks > 0) { if (device->num_joysticks > 0) {
joystick = SDL_JoystickFromInstanceID(device->joysticks[0]); joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]);
} else { } else {
return SDL_FALSE; return SDL_FALSE;
} }

View File

@ -176,7 +176,7 @@ static SDL_bool HIDAPI_DriverXbox360W_OpenJoystick(SDL_HIDAPI_Device *device, SD
SDL_zeroa(ctx->last_state); SDL_zeroa(ctx->last_state);
/* Initialize player index (needed for setting LEDs) */ /* 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); ctx->player_lights = SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED, SDL_TRUE);
UpdateSlotLED(ctx); UpdateSlotLED(ctx);
@ -287,7 +287,7 @@ static SDL_bool HIDAPI_DriverXbox360W_UpdateDevice(SDL_HIDAPI_Device *device)
int size; int size;
if (device->num_joysticks > 0) { 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) { while ((size = SDL_hid_read_timeout(device->dev, data, sizeof(data), 0)) > 0) {

View File

@ -1132,7 +1132,7 @@ static SDL_bool HIDAPI_DriverXboxOne_UpdateDevice(SDL_HIDAPI_Device *device)
int size; int size;
if (device->num_joysticks > 0) { if (device->num_joysticks > 0) {
joystick = SDL_JoystickFromInstanceID(device->joysticks[0]); joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]);
} else { } else {
return SDL_FALSE; return SDL_FALSE;
} }

View File

@ -667,7 +667,7 @@ void HIDAPI_JoystickDisconnected(SDL_HIDAPI_Device *device, SDL_JoystickID joyst
for (i = 0; i < device->num_joysticks; ++i) { for (i = 0; i < device->num_joysticks; ++i) {
if (device->joysticks[i] == joystickID) { if (device->joysticks[i] == joystickID) {
SDL_Joystick *joystick = SDL_JoystickFromInstanceID(joystickID); SDL_Joystick *joystick = SDL_GetJoystickFromInstanceID(joystickID);
if (joystick) { if (joystick) {
HIDAPI_JoystickClose(joystick); HIDAPI_JoystickClose(joystick);
} }

View File

@ -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 */ /* 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]) { if (joystick->hwdata->has_key[BTN_WEST]) {
out->x.kind = EMappingKind_Button; out->x.kind = EMappingKind_Button;
out->x.target = joystick->hwdata->key_map[BTN_WEST]; out->x.target = joystick->hwdata->key_map[BTN_WEST];

View File

@ -226,7 +226,7 @@ static void VITA_JoystickUpdate(SDL_Joystick *joystick)
SceCtrlData *pad = NULL; SceCtrlData *pad = NULL;
Uint64 timestamp = SDL_GetTicksNS(); Uint64 timestamp = SDL_GetTicksNS();
int index = (int)SDL_JoystickInstanceID(joystick); int index = (int)SDL_GetJoystickInstanceID(joystick);
if (index == 0) if (index == 0)
pad = &pad0; 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) 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; SceCtrlActuator act;
SDL_zero(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) 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) { if (sceCtrlSetLightBar(ext_port_map[index], red, green, blue) < 0) {
return SDL_Unsupported(); return SDL_Unsupported();
} }

View File

@ -368,11 +368,11 @@ WatchJoystick(SDL_Joystick *joystick)
SDL_RenderSetLogicalSize(screen, SCREEN_WIDTH, SCREEN_HEIGHT); SDL_RenderSetLogicalSize(screen, SCREEN_WIDTH, SCREEN_HEIGHT);
/* Print info about the joystick we are watching */ /* Print info about the joystick we are watching */
name = SDL_JoystickName(joystick); name = SDL_GetJoystickName(joystick);
SDL_Log("Watching joystick %" SDL_PRIs32 ": (%s)\n", SDL_JoystickInstanceID(joystick), SDL_Log("Watching joystick %" SDL_PRIs32 ": (%s)\n", SDL_GetJoystickInstanceID(joystick),
name ? name : "Unknown Joystick"); name ? name : "Unknown Joystick");
SDL_Log("Joystick has %d axes, %d hats, and %d buttons\n", 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\ SDL_Log("\n\n\
====================================================================================\n\ ====================================================================================\n\
@ -383,9 +383,9 @@ WatchJoystick(SDL_Joystick *joystick)
To exit, press ESC\n\ To exit, press ESC\n\
====================================================================================\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)); s_arrAxisState = (AxisState *)SDL_calloc(s_nNumAxes, sizeof(*s_arrAxisState));
/* Skip any spurious events at start */ /* Skip any spurious events at start */
@ -448,7 +448,7 @@ WatchJoystick(SDL_Joystick *joystick)
int nCurrentDistance, nFarthestDistance; int nCurrentDistance, nFarthestDistance;
if (!pAxisState->m_bMoving) { if (!pAxisState->m_bMoving) {
Sint16 nInitialValue; 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_nLastValue = nValue;
pAxisState->m_nStartingValue = nInitialValue; pAxisState->m_nStartingValue = nInitialValue;
pAxisState->m_nFarthestValue = nInitialValue; pAxisState->m_nFarthestValue = nInitialValue;
@ -570,14 +570,14 @@ WatchJoystick(SDL_Joystick *joystick)
} }
/* Initialize mapping with GUID and name */ /* Initialize mapping with GUID and name */
guid = SDL_JoystickGetGUID(joystick); guid = SDL_GetJoystickGUID(joystick);
SDL_GetJoystickGUIDInfo(guid, NULL, NULL, NULL, &crc); SDL_GetJoystickGUIDInfo(guid, NULL, NULL, NULL, &crc);
if (crc) { if (crc) {
/* Clear the CRC from the GUID for the mapping */ /* Clear the CRC from the GUID for the mapping */
guid.data[2] = 0; guid.data[2] = 0;
guid.data[3] = 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, ",", SDL_arraysize(mapping));
SDL_strlcat(mapping, trimmed_name, SDL_arraysize(mapping)); SDL_strlcat(mapping, trimmed_name, SDL_arraysize(mapping));
SDL_strlcat(mapping, ",", SDL_arraysize(mapping)); SDL_strlcat(mapping, ",", SDL_arraysize(mapping));
@ -737,7 +737,7 @@ int main(int argc, char *argv[])
return 2; return 2;
} }
while (!done && SDL_NumJoysticks() == 0) { while (!done && SDL_GetNumJoysticks() == 0) {
SDL_Event event; SDL_Event event;
while (SDL_PollEvent(&event) > 0) { while (SDL_PollEvent(&event) > 0) {
@ -758,25 +758,25 @@ int main(int argc, char *argv[])
} }
/* Print information about the joysticks */ /* Print information about the joysticks */
SDL_Log("There are %d joysticks attached\n", SDL_NumJoysticks()); SDL_Log("There are %d joysticks attached\n", SDL_GetNumJoysticks());
for (i = 0; i < SDL_NumJoysticks(); ++i) { for (i = 0; i < SDL_GetNumJoysticks(); ++i) {
name = SDL_JoystickNameForIndex(i); name = SDL_GetJoystickNameForIndex(i);
SDL_Log("Joystick %d: %s\n", i, name ? name : "Unknown Joystick"); SDL_Log("Joystick %d: %s\n", i, name ? name : "Unknown Joystick");
joystick = SDL_JoystickOpen(i); joystick = SDL_OpenJoystick(i);
if (joystick == NULL) { 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()); SDL_GetError());
} else { } else {
char guid[64]; char guid[64];
SDL_JoystickGetGUIDString(SDL_JoystickGetGUID(joystick), SDL_GetJoystickGUIDString(SDL_GetJoystickGUID(joystick),
guid, sizeof(guid)); guid, sizeof(guid));
SDL_Log(" axes: %d\n", SDL_JoystickNumAxes(joystick)); SDL_Log(" axes: %d\n", SDL_GetNumJoystickAxes(joystick));
SDL_Log(" hats: %d\n", SDL_JoystickNumHats(joystick)); SDL_Log(" hats: %d\n", SDL_GetNumJoystickHats(joystick));
SDL_Log(" buttons: %d\n", SDL_JoystickNumButtons(joystick)); SDL_Log(" buttons: %d\n", SDL_GetNumJoystickButtons(joystick));
SDL_Log("instance id: %" SDL_PRIu32 "\n", SDL_JoystickInstanceID(joystick)); SDL_Log("instance id: %" SDL_PRIu32 "\n", SDL_GetJoystickInstanceID(joystick));
SDL_Log(" guid: %s\n", guid); SDL_Log(" guid: %s\n", guid);
SDL_Log(" VID/PID: 0x%.4x/0x%.4x\n", SDL_JoystickGetVendor(joystick), SDL_JoystickGetProduct(joystick)); SDL_Log(" VID/PID: 0x%.4x/0x%.4x\n", SDL_GetJoystickVendor(joystick), SDL_GetJoystickProduct(joystick));
SDL_JoystickClose(joystick); SDL_CloseJoystick(joystick);
} }
} }
@ -787,12 +787,12 @@ int main(int argc, char *argv[])
break; break;
} }
} }
joystick = SDL_JoystickOpen(joystick_index); joystick = SDL_OpenJoystick(joystick_index);
if (joystick == NULL) { if (joystick == NULL) {
SDL_Log("Couldn't open joystick %d: %s\n", joystick_index, SDL_GetError()); SDL_Log("Couldn't open joystick %d: %s\n", joystick_index, SDL_GetError());
} else { } else {
WatchJoystick(joystick); WatchJoystick(joystick);
SDL_JoystickClose(joystick); SDL_CloseJoystick(joystick);
} }
SDL_DestroyWindow(window); SDL_DestroyWindow(window);

View File

@ -13,7 +13,7 @@
/** /**
* @brief Check virtual joystick creation * @brief Check virtual joystick creation
* *
* @sa SDL_JoystickAttachVirtualEx * @sa SDL_AttachVirtualJoystickEx
*/ */
static int static int
TestVirtualJoystick(void *arg) TestVirtualJoystick(void *arg)
@ -32,36 +32,36 @@ TestVirtualJoystick(void *arg)
desc.vendor_id = USB_VENDOR_NVIDIA; desc.vendor_id = USB_VENDOR_NVIDIA;
desc.product_id = USB_PRODUCT_NVIDIA_SHIELD_CONTROLLER_V104; desc.product_id = USB_PRODUCT_NVIDIA_SHIELD_CONTROLLER_V104;
desc.name = "Virtual NVIDIA SHIELD Controller"; desc.name = "Virtual NVIDIA SHIELD Controller";
device_index = SDL_JoystickAttachVirtualEx(&desc); device_index = SDL_AttachVirtualJoystickEx(&desc);
SDLTest_AssertCheck(device_index >= 0, "SDL_JoystickAttachVirtualEx()"); SDLTest_AssertCheck(device_index >= 0, "SDL_AttachVirtualJoystickEx()");
SDLTest_AssertCheck(SDL_JoystickIsVirtual(device_index), "SDL_JoystickIsVirtual()"); SDLTest_AssertCheck(SDL_IsJoystickVirtual(device_index), "SDL_IsJoystickVirtual()");
if (device_index >= 0) { if (device_index >= 0) {
joystick = SDL_JoystickOpen(device_index); joystick = SDL_OpenJoystick(device_index);
SDLTest_AssertCheck(joystick != NULL, "SDL_JoystickOpen()"); SDLTest_AssertCheck(joystick != NULL, "SDL_OpenJoystick()");
if (joystick) { if (joystick) {
SDLTest_AssertCheck(SDL_strcmp(SDL_JoystickName(joystick), desc.name) == 0, "SDL_JoystickName()"); SDLTest_AssertCheck(SDL_strcmp(SDL_GetJoystickName(joystick), desc.name) == 0, "SDL_GetJoystickName()");
SDLTest_AssertCheck(SDL_JoystickGetVendor(joystick) == desc.vendor_id, "SDL_JoystickGetVendor()"); SDLTest_AssertCheck(SDL_GetJoystickVendor(joystick) == desc.vendor_id, "SDL_GetJoystickVendor()");
SDLTest_AssertCheck(SDL_JoystickGetProduct(joystick) == desc.product_id, "SDL_JoystickGetProduct()"); SDLTest_AssertCheck(SDL_GetJoystickProduct(joystick) == desc.product_id, "SDL_GetJoystickProduct()");
SDLTest_AssertCheck(SDL_JoystickGetProductVersion(joystick) == 0, "SDL_JoystickGetProductVersion()"); SDLTest_AssertCheck(SDL_GetJoystickProductVersion(joystick) == 0, "SDL_GetJoystickProductVersion()");
SDLTest_AssertCheck(SDL_JoystickGetFirmwareVersion(joystick) == 0, "SDL_JoystickGetFirmwareVersion()"); SDLTest_AssertCheck(SDL_GetJoystickFirmwareVersion(joystick) == 0, "SDL_GetJoystickFirmwareVersion()");
SDLTest_AssertCheck(SDL_JoystickGetSerial(joystick) == NULL, "SDL_JoystickGetSerial()"); SDLTest_AssertCheck(SDL_GetJoystickSerial(joystick) == NULL, "SDL_GetJoystickSerial()");
SDLTest_AssertCheck(SDL_JoystickGetType(joystick) == desc.type, "SDL_JoystickGetType()"); SDLTest_AssertCheck(SDL_GetJoystickType(joystick) == desc.type, "SDL_GetJoystickType()");
SDLTest_AssertCheck(SDL_JoystickNumAxes(joystick) == desc.naxes, "SDL_JoystickNumAxes()"); SDLTest_AssertCheck(SDL_GetNumJoystickAxes(joystick) == desc.naxes, "SDL_GetNumJoystickAxes()");
SDLTest_AssertCheck(SDL_JoystickNumHats(joystick) == desc.nhats, "SDL_JoystickNumHats()"); SDLTest_AssertCheck(SDL_GetNumJoystickHats(joystick) == desc.nhats, "SDL_GetNumJoystickHats()");
SDLTest_AssertCheck(SDL_JoystickNumButtons(joystick) == desc.nbuttons, "SDL_JoystickNumButtons()"); 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)"); SDLTest_AssertCheck(SDL_SetJoystickVirtualButton(joystick, SDL_CONTROLLER_BUTTON_A, SDL_PRESSED) == 0, "SDL_SetJoystickVirtualButton(SDL_CONTROLLER_BUTTON_A, SDL_PRESSED)");
SDL_JoystickUpdate(); SDL_UpdateJoysticks();
SDLTest_AssertCheck(SDL_JoystickGetButton(joystick, SDL_CONTROLLER_BUTTON_A) == SDL_PRESSED, "SDL_JoystickGetButton(SDL_CONTROLLER_BUTTON_A) == SDL_PRESSED"); SDLTest_AssertCheck(SDL_GetJoystickButton(joystick, SDL_CONTROLLER_BUTTON_A) == SDL_PRESSED, "SDL_GetJoystickButton(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)"); SDLTest_AssertCheck(SDL_SetJoystickVirtualButton(joystick, SDL_CONTROLLER_BUTTON_A, SDL_RELEASED) == 0, "SDL_SetJoystickVirtualButton(SDL_CONTROLLER_BUTTON_A, SDL_RELEASED)");
SDL_JoystickUpdate(); SDL_UpdateJoysticks();
SDLTest_AssertCheck(SDL_JoystickGetButton(joystick, SDL_CONTROLLER_BUTTON_A) == SDL_RELEASED, "SDL_JoystickGetButton(SDL_CONTROLLER_BUTTON_A) == SDL_RELEASED"); 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); SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER);

View File

@ -158,7 +158,7 @@ static int FindController(SDL_JoystickID controller_id)
int i; int i;
for (i = 0; i < num_controllers; ++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; return i;
} }
} }
@ -167,7 +167,7 @@ static int FindController(SDL_JoystickID controller_id)
static void AddController(int device_index, SDL_bool verbose) 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 *controller;
SDL_GameController **controllers; SDL_GameController **controllers;
Uint16 firmware_version; Uint16 firmware_version;
@ -181,7 +181,7 @@ static void AddController(int device_index, SDL_bool verbose)
}; };
unsigned int i; unsigned int i;
controller_id = SDL_JoystickGetDeviceInstanceID(device_index); controller_id = SDL_GetJoystickDeviceInstanceID(device_index);
if (controller_id < 0) { if (controller_id < 0) {
SDL_Log("Couldn't get controller ID: %s\n", SDL_GetError()); SDL_Log("Couldn't get controller ID: %s\n", SDL_GetError());
return; return;
@ -400,11 +400,11 @@ static void OpenVirtualController()
desc.RumbleTriggers = VirtualControllerRumbleTriggers; desc.RumbleTriggers = VirtualControllerRumbleTriggers;
desc.SetLED = VirtualControllerSetLED; desc.SetLED = VirtualControllerSetLED;
virtual_index = SDL_JoystickAttachVirtualEx(&desc); virtual_index = SDL_AttachVirtualJoystickEx(&desc);
if (virtual_index < 0) { if (virtual_index < 0) {
SDL_Log("Couldn't open virtual device: %s\n", SDL_GetError()); SDL_Log("Couldn't open virtual device: %s\n", SDL_GetError());
} else { } else {
virtual_joystick = SDL_JoystickOpen(virtual_index); virtual_joystick = SDL_OpenJoystick(virtual_index);
if (virtual_joystick == NULL) { if (virtual_joystick == NULL) {
SDL_Log("Couldn't open virtual device: %s\n", SDL_GetError()); SDL_Log("Couldn't open virtual device: %s\n", SDL_GetError());
} }
@ -415,14 +415,14 @@ static void CloseVirtualController()
{ {
int i; int i;
for (i = SDL_NumJoysticks(); i--;) { for (i = SDL_GetNumJoysticks(); i--;) {
if (SDL_JoystickIsVirtual(i)) { if (SDL_IsJoystickVirtual(i)) {
SDL_JoystickDetachVirtual(i); SDL_DetachVirtualJoystick(i);
} }
} }
if (virtual_joystick) { if (virtual_joystick) {
SDL_JoystickClose(virtual_joystick); SDL_CloseJoystick(virtual_joystick);
virtual_joystick = NULL; virtual_joystick = NULL;
} }
} }
@ -481,7 +481,7 @@ static void VirtualControllerMouseMotion(int x, int y)
const int MOVING_DISTANCE = 2; const int MOVING_DISTANCE = 2;
if (SDL_abs(x - virtual_axis_start_x) >= MOVING_DISTANCE || if (SDL_abs(x - virtual_axis_start_x) >= MOVING_DISTANCE ||
SDL_abs(y - virtual_axis_start_y) >= 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; 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); 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); 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)); 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 { } else {
float distanceX = SDL_clamp(((float)x - virtual_axis_start_x) / AXIS_SIZE, -1.0f, 1.0f); 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); 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 { } else {
valueY = (Sint16)(distanceY * -SDL_JOYSTICK_AXIS_MIN); valueY = (Sint16)(distanceY * -SDL_JOYSTICK_AXIS_MIN);
} }
SDL_JoystickSetVirtualAxis(virtual_joystick, virtual_axis_active, valueX); SDL_SetJoystickVirtualAxis(virtual_joystick, virtual_axis_active, valueX);
SDL_JoystickSetVirtualAxis(virtual_joystick, virtual_axis_active + 1, valueY); SDL_SetJoystickVirtualAxis(virtual_joystick, virtual_axis_active + 1, valueY);
} }
} }
} }
@ -523,7 +523,7 @@ static void VirtualControllerMouseDown(int x, int y)
button = FindButtonAtPosition(x, y); button = FindButtonAtPosition(x, y);
if (button != SDL_CONTROLLER_BUTTON_INVALID) { if (button != SDL_CONTROLLER_BUTTON_INVALID) {
virtual_button_active = button; 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); axis = FindAxisAtPosition(x, y);
@ -537,17 +537,17 @@ static void VirtualControllerMouseDown(int x, int y)
static void VirtualControllerMouseUp(int x, int y) static void VirtualControllerMouseUp(int x, int y)
{ {
if (virtual_button_active != SDL_CONTROLLER_BUTTON_INVALID) { 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; virtual_button_active = SDL_CONTROLLER_BUTTON_INVALID;
} }
if (virtual_axis_active != SDL_CONTROLLER_AXIS_INVALID) { if (virtual_axis_active != SDL_CONTROLLER_AXIS_INVALID) {
if (virtual_axis_active == SDL_CONTROLLER_AXIS_TRIGGERLEFT || if (virtual_axis_active == SDL_CONTROLLER_AXIS_TRIGGERLEFT ||
virtual_axis_active == SDL_CONTROLLER_AXIS_TRIGGERRIGHT) { 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 { } else {
SDL_JoystickSetVirtualAxis(virtual_joystick, virtual_axis_active, 0); SDL_SetJoystickVirtualAxis(virtual_joystick, virtual_axis_active, 0);
SDL_JoystickSetVirtualAxis(virtual_joystick, virtual_axis_active + 1, 0); SDL_SetJoystickVirtualAxis(virtual_joystick, virtual_axis_active + 1, 0);
} }
virtual_axis_active = SDL_CONTROLLER_AXIS_INVALID; 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) { while (SDL_PeepEvents(&event, 1, SDL_GETEVENT, SDL_FIRSTEVENT, SDL_LASTEVENT) == 1) {
switch (event.type) { switch (event.type) {
case SDL_CONTROLLERDEVICEADDED: 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); AddController(event.cdevice.which, SDL_TRUE);
break; break;
@ -823,12 +823,12 @@ int main(int argc, char *argv[])
} }
/* Print information about the controller */ /* Print information about the controller */
for (i = 0; i < SDL_NumJoysticks(); ++i) { for (i = 0; i < SDL_GetNumJoysticks(); ++i) {
const char *name; const char *name;
const char *path; const char *path;
const char *description; const char *description;
SDL_JoystickGetGUIDString(SDL_JoystickGetDeviceGUID(i), SDL_GetJoystickGUIDString(SDL_GetJoystickDeviceGUID(i),
guid, sizeof(guid)); guid, sizeof(guid));
if (SDL_IsGameController(i)) { if (SDL_IsGameController(i)) {
@ -874,15 +874,15 @@ int main(int argc, char *argv[])
} }
AddController(i, SDL_FALSE); AddController(i, SDL_FALSE);
} else { } else {
name = SDL_JoystickNameForIndex(i); name = SDL_GetJoystickNameForIndex(i);
path = SDL_JoystickPathForIndex(i); path = SDL_GetJoystickPathForIndex(i);
description = "Joystick"; description = "Joystick";
} }
SDL_Log("%s %d: %s%s%s (guid %s, VID 0x%.4x, PID 0x%.4x, player index = %d)\n", 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, 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 */ /* Create a window to display controller state */
window = SDL_CreateWindow("Game Controller Test", SDL_WINDOWPOS_CENTERED, window = SDL_CreateWindow("Game Controller Test", SDL_WINDOWPOS_CENTERED,

View File

@ -52,7 +52,7 @@ int main(int argc, char *argv[])
//SDL_CreateWindow("Dummy", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 128, 128, 0); //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) { if (enable_haptic) {
SDL_Log("There are %d haptic devices at startup\n", SDL_NumHaptics()); 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) { if (joystick != NULL) {
SDL_Log("Only one joystick supported by this test\n"); SDL_Log("Only one joystick supported by this test\n");
} else { } else {
joystick = SDL_JoystickOpen(event.jdevice.which); joystick = SDL_OpenJoystick(event.jdevice.which);
instance = SDL_JoystickInstanceID(joystick); instance = SDL_GetJoystickInstanceID(joystick);
SDL_Log("Joy Added : %" SDL_PRIs32 " : %s\n", event.jdevice.which, SDL_JoystickName(joystick)); SDL_Log("Joy Added : %" SDL_PRIs32 " : %s\n", event.jdevice.which, SDL_GetJoystickName(joystick));
if (enable_haptic) { if (enable_haptic) {
if (SDL_JoystickIsHaptic(joystick)) { if (SDL_JoystickIsHaptic(joystick)) {
haptic = SDL_HapticOpenFromJoystick(joystick); haptic = SDL_HapticOpenFromJoystick(joystick);
@ -98,7 +98,7 @@ int main(int argc, char *argv[])
SDL_HapticClose(haptic); SDL_HapticClose(haptic);
haptic = NULL; haptic = NULL;
} }
SDL_JoystickClose(joystick); SDL_CloseJoystick(joystick);
joystick = NULL; joystick = NULL;
} else { } else {
SDL_Log("Unknown joystick diconnected\n"); SDL_Log("Unknown joystick diconnected\n");

View File

@ -40,9 +40,9 @@ PrintJoystick(SDL_Joystick *joy)
const char *type; const char *type;
char guid[64]; char guid[64];
SDL_assert(SDL_JoystickFromInstanceID(SDL_JoystickInstanceID(joy)) == joy); SDL_assert(SDL_GetJoystickFromInstanceID(SDL_GetJoystickInstanceID(joy)) == joy);
SDL_JoystickGetGUIDString(SDL_JoystickGetGUID(joy), guid, sizeof(guid)); SDL_GetJoystickGUIDString(SDL_GetJoystickGUID(joy), guid, sizeof(guid));
switch (SDL_JoystickGetType(joy)) { switch (SDL_GetJoystickType(joy)) {
case SDL_JOYSTICK_TYPE_GAMECONTROLLER: case SDL_JOYSTICK_TYPE_GAMECONTROLLER:
type = "Game Controller"; type = "Game Controller";
break; break;
@ -75,17 +75,17 @@ PrintJoystick(SDL_Joystick *joy)
break; break;
} }
SDL_Log("Joystick\n"); 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(" type: %s\n", type);
SDL_Log(" LED: %s\n", SDL_JoystickHasLED(joy) ? "yes" : "no"); SDL_Log(" LED: %s\n", SDL_JoystickHasLED(joy) ? "yes" : "no");
SDL_Log(" rumble: %s\n", SDL_JoystickHasRumble(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("trigger rumble: %s\n", SDL_JoystickHasRumbleTriggers(joy) ? "yes" : "no");
SDL_Log(" axes: %d\n", SDL_JoystickNumAxes(joy)); SDL_Log(" axes: %d\n", SDL_GetNumJoystickAxes(joy));
SDL_Log(" hats: %d\n", SDL_JoystickNumHats(joy)); SDL_Log(" hats: %d\n", SDL_GetNumJoystickHats(joy));
SDL_Log(" buttons: %d\n", SDL_JoystickNumButtons(joy)); SDL_Log(" buttons: %d\n", SDL_GetNumJoystickButtons(joy));
SDL_Log(" instance id: %" SDL_PRIs32 "\n", SDL_JoystickInstanceID(joy)); SDL_Log(" instance id: %" SDL_PRIs32 "\n", SDL_GetJoystickInstanceID(joy));
SDL_Log(" guid: %s\n", guid); 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 static void
@ -114,7 +114,7 @@ void loop(void *arg)
case SDL_JOYDEVICEADDED: case SDL_JOYDEVICEADDED:
SDL_Log("Joystick device %d added.\n", (int)event.jdevice.which); SDL_Log("Joystick device %d added.\n", (int)event.jdevice.which);
if (joystick == NULL) { if (joystick == NULL) {
joystick = SDL_JoystickOpen(event.jdevice.which); joystick = SDL_OpenJoystick(event.jdevice.which);
if (joystick) { if (joystick) {
PrintJoystick(joystick); PrintJoystick(joystick);
} else { } else {
@ -125,9 +125,9 @@ void loop(void *arg)
case SDL_JOYDEVICEREMOVED: case SDL_JOYDEVICEREMOVED:
SDL_Log("Joystick device %d removed.\n", (int)event.jdevice.which); SDL_Log("Joystick device %d removed.\n", (int)event.jdevice.which);
if (event.jdevice.which == SDL_JoystickInstanceID(joystick)) { if (event.jdevice.which == SDL_GetJoystickInstanceID(joystick)) {
SDL_JoystickClose(joystick); SDL_CloseJoystick(joystick);
joystick = SDL_JoystickOpen(0); joystick = SDL_OpenJoystick(0);
} }
break; break;
@ -161,7 +161,7 @@ void loop(void *arg)
event.jbutton.which, event.jbutton.button); event.jbutton.which, event.jbutton.button);
/* First button triggers a 0.5 second full strength rumble */ /* First button triggers a 0.5 second full strength rumble */
if (event.jbutton.button == 0) { if (event.jbutton.button == 0) {
SDL_JoystickRumble(joystick, 0xFFFF, 0xFFFF, 500); SDL_RumbleJoystick(joystick, 0xFFFF, 0xFFFF, 500);
} }
break; break;
case SDL_JOYBUTTONUP: case SDL_JOYBUTTONUP:
@ -198,21 +198,21 @@ void loop(void *arg)
/* Update visual joystick state */ /* Update visual joystick state */
SDL_SetRenderDrawColor(screen, 0x00, 0xFF, 0x00, SDL_ALPHA_OPAQUE); SDL_SetRenderDrawColor(screen, 0x00, 0xFF, 0x00, SDL_ALPHA_OPAQUE);
y = SCREEN_HEIGHT - ((((SDL_JoystickNumButtons(joystick) + (BUTTONS_PER_LINE - 1)) / BUTTONS_PER_LINE) + 1) * 34); y = SCREEN_HEIGHT - ((((SDL_GetNumJoystickButtons(joystick) + (BUTTONS_PER_LINE - 1)) / BUTTONS_PER_LINE) + 1) * 34);
for (i = 0; i < SDL_JoystickNumButtons(joystick); ++i) { for (i = 0; i < SDL_GetNumJoystickButtons(joystick); ++i) {
if ((i % BUTTONS_PER_LINE) == 0) { if ((i % BUTTONS_PER_LINE) == 0) {
y += 34; y += 34;
} }
if (SDL_JoystickGetButton(joystick, i) == SDL_PRESSED) { if (SDL_GetJoystickButton(joystick, i) == SDL_PRESSED) {
x = 2 + (i % BUTTONS_PER_LINE) * 34; x = 2 + (i % BUTTONS_PER_LINE) * 34;
DrawRect(screen, x, y, 32, 32); DrawRect(screen, x, y, 32, 32);
} }
} }
SDL_SetRenderDrawColor(screen, 0xFF, 0x00, 0x00, SDL_ALPHA_OPAQUE); 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 */ /* Draw the X/Y axis */
x = (((int)SDL_JoystickGetAxis(joystick, i)) + 32768); x = (((int)SDL_GetJoystickAxis(joystick, i)) + 32768);
x *= SCREEN_WIDTH; x *= SCREEN_WIDTH;
x /= 65535; x /= 65535;
if (x < 0) { if (x < 0) {
@ -221,8 +221,8 @@ void loop(void *arg)
x = SCREEN_WIDTH - 16; x = SCREEN_WIDTH - 16;
} }
++i; ++i;
if (i < SDL_JoystickNumAxes(joystick)) { if (i < SDL_GetNumJoystickAxes(joystick)) {
y = (((int)SDL_JoystickGetAxis(joystick, i)) + 32768); y = (((int)SDL_GetJoystickAxis(joystick, i)) + 32768);
} else { } else {
y = 32768; y = 32768;
} }
@ -238,9 +238,9 @@ void loop(void *arg)
} }
SDL_SetRenderDrawColor(screen, 0x00, 0x00, 0xFF, SDL_ALPHA_OPAQUE); 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 */ /* Derive the new position */
const Uint8 hat_pos = SDL_JoystickGetHat(joystick, i); const Uint8 hat_pos = SDL_GetJoystickHat(joystick, i);
x = SCREEN_WIDTH / 2; x = SCREEN_WIDTH / 2;
y = SCREEN_HEIGHT / 2; y = SCREEN_HEIGHT / 2;