mirror of
https://github.com/encounter/SDL.git
synced 2025-12-16 08:27:05 +00:00
Added a function to get the controller firmware version
This commit is contained in:
@@ -2360,6 +2360,12 @@ SDL_GameControllerGetProductVersion(SDL_GameController *gamecontroller)
|
||||
return SDL_JoystickGetProductVersion(SDL_GameControllerGetJoystick(gamecontroller));
|
||||
}
|
||||
|
||||
Uint16
|
||||
SDL_GameControllerGetFirmwareVersion(SDL_GameController *gamecontroller)
|
||||
{
|
||||
return SDL_JoystickGetFirmwareVersion(SDL_GameControllerGetJoystick(gamecontroller));
|
||||
}
|
||||
|
||||
const char *
|
||||
SDL_GameControllerGetSerial(SDL_GameController *gamecontroller)
|
||||
{
|
||||
|
||||
@@ -2702,6 +2702,14 @@ Uint16 SDL_JoystickGetProductVersion(SDL_Joystick *joystick)
|
||||
return version;
|
||||
}
|
||||
|
||||
Uint16 SDL_JoystickGetFirmwareVersion(SDL_Joystick *joystick)
|
||||
{
|
||||
if (!SDL_PrivateJoystickValid(joystick)) {
|
||||
return 0;
|
||||
}
|
||||
return joystick->firmware_version;
|
||||
}
|
||||
|
||||
const char *SDL_JoystickGetSerial(SDL_Joystick *joystick)
|
||||
{
|
||||
if (!SDL_PrivateJoystickValid(joystick)) {
|
||||
|
||||
@@ -68,6 +68,7 @@ struct _SDL_Joystick
|
||||
char *path; /* Joystick path - system dependent */
|
||||
char *serial; /* Joystick serial */
|
||||
SDL_JoystickGUID guid; /* Joystick guid */
|
||||
Uint16 firmware_version; /* Firmware version, if available */
|
||||
|
||||
int naxes; /* Number of axis controls on the joystick */
|
||||
SDL_JoystickAxisInfo *axes;
|
||||
|
||||
Reference in New Issue
Block a user