joystick: Convert HasLED() into a generic GetCapabilities() function

This commit is contained in:
Cameron Gutman
2021-11-11 11:13:08 -06:00
committed by Sam Lantinga
parent 1ba695dc94
commit 1ccfbf963e
34 changed files with 156 additions and 114 deletions

View File

@@ -121,6 +121,9 @@ struct _SDL_Joystick
#define SDL_HARDWARE_BUS_USB 0x03
#define SDL_HARDWARE_BUS_BLUETOOTH 0x05
/* Joystick capability flags for GetCapabilities() */
#define SDL_JOYCAP_LED 0x01
/* Macro to combine a USB vendor ID and product ID into a single Uint32 value */
#define MAKE_VIDPID(VID, PID) (((Uint32)(VID))<<16|(PID))
@@ -164,8 +167,10 @@ typedef struct _SDL_JoystickDriver
int (*Rumble)(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble);
int (*RumbleTriggers)(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble);
/* Capability detection */
Uint32 (*GetCapabilities)(SDL_Joystick *joystick);
/* LED functionality */
SDL_bool (*HasLED)(SDL_Joystick *joystick);
int (*SetLED)(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue);
/* General effects */