Add SDL_JoystickSetLED.

Currently, this is only supported by the PS4 HIDAPI driver.
This commit is contained in:
Ethan Lee 2020-04-30 11:57:29 -04:00
parent 1b8dee7caf
commit 83cddd2ebc
24 changed files with 229 additions and 1 deletions

View file

@ -64,6 +64,10 @@ struct _SDL_Joystick
Uint16 high_frequency_rumble;
Uint32 rumble_expiration;
Uint8 led_red;
Uint8 led_green;
Uint8 led_blue;
SDL_bool attached;
SDL_bool is_game_controller;
SDL_bool delayed_guide_button; /* SDL_TRUE if this device has the guide button event delayed */
@ -123,6 +127,9 @@ typedef struct _SDL_JoystickDriver
/* Rumble functionality */
int (*Rumble)(SDL_Joystick * joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble);
/* LED functionality */
int (*SetLED)(SDL_Joystick * joystick, Uint8 red, Uint8 green, Uint8 blue);
/* Function to update the state of a joystick - called as a device poll.
* This function shouldn't update the joystick structure directly,
* but instead should call SDL_PrivateJoystick*() to deliver events