mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-03 00:18:28 +00:00
Added SDL_GetJoystickCaps() and SDL_GetGamepadCaps() to get the capabilities of controllers
Also added SDL_GAMEPAD_CAP_PLAYER_LED to let the application know if the controller has a visible player LED
This commit is contained in:
@@ -3485,34 +3485,14 @@ int SDL_RumbleGamepadTriggers(SDL_Gamepad *gamepad, Uint16 left_rumble, Uint16 r
|
||||
return SDL_RumbleJoystickTriggers(joystick, left_rumble, right_rumble, duration_ms);
|
||||
}
|
||||
|
||||
SDL_bool SDL_GamepadHasLED(SDL_Gamepad *gamepad)
|
||||
Uint32 SDL_GetGamepadCaps(SDL_Gamepad *gamepad)
|
||||
{
|
||||
SDL_Joystick *joystick = SDL_GetGamepadJoystick(gamepad);
|
||||
|
||||
if (!joystick) {
|
||||
return SDL_FALSE;
|
||||
return 0;
|
||||
}
|
||||
return SDL_JoystickHasLED(joystick);
|
||||
}
|
||||
|
||||
SDL_bool SDL_GamepadHasRumble(SDL_Gamepad *gamepad)
|
||||
{
|
||||
SDL_Joystick *joystick = SDL_GetGamepadJoystick(gamepad);
|
||||
|
||||
if (!joystick) {
|
||||
return SDL_FALSE;
|
||||
}
|
||||
return SDL_JoystickHasRumble(joystick);
|
||||
}
|
||||
|
||||
SDL_bool SDL_GamepadHasRumbleTriggers(SDL_Gamepad *gamepad)
|
||||
{
|
||||
SDL_Joystick *joystick = SDL_GetGamepadJoystick(gamepad);
|
||||
|
||||
if (!joystick) {
|
||||
return SDL_FALSE;
|
||||
}
|
||||
return SDL_JoystickHasRumbleTriggers(joystick);
|
||||
return SDL_GetJoystickCaps(joystick);
|
||||
}
|
||||
|
||||
int SDL_SetGamepadLED(SDL_Gamepad *gamepad, Uint8 red, Uint8 green, Uint8 blue)
|
||||
|
Reference in New Issue
Block a user