joystick: SDL_VirtualJoystickDesc no longer takes a struct version.

If we need to extend this in the future, we'll make a second struct and
a second SDL_AttachVirtualJoystickEx-style function that uses it.

Just zero the struct and don't set a version.

Fixes #9489.
This commit is contained in:
Ryan C. Gordon
2024-04-13 14:15:16 -04:00
parent 202bd7b0ff
commit d252a8fe12
6 changed files with 4 additions and 20 deletions

View File

@@ -360,10 +360,7 @@ extern DECLSPEC SDL_JoystickID SDLCALL SDL_AttachVirtualJoystick(SDL_JoystickTyp
/**
* 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_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.
*
* \since This struct is available since SDL 3.0.0.
*
@@ -371,7 +368,6 @@ extern DECLSPEC SDL_JoystickID SDLCALL SDL_AttachVirtualJoystick(SDL_JoystickTyp
*/
typedef struct SDL_VirtualJoystickDesc
{
Uint16 version; /**< `SDL_VIRTUAL_JOYSTICK_DESC_VERSION` */
Uint16 type; /**< `SDL_JoystickType` */
Uint16 naxes; /**< the number of axes on this joystick */
Uint16 nbuttons; /**< the number of buttons on this joystick */
@@ -392,16 +388,8 @@ typedef struct SDL_VirtualJoystickDesc
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_SetJoystickLED() */
int (SDLCALL *SendEffect)(void *userdata, const void *data, int size); /**< Implements SDL_SendJoystickEffect() */
} SDL_VirtualJoystickDesc;
/**
* The current version of the SDL_VirtualJoystickDesc structure.
*
* \since This macro is available since SDL 3.0.0.
*/
#define SDL_VIRTUAL_JOYSTICK_DESC_VERSION 1
/**
* Attach a new virtual joystick with extended properties.
*