Added SDL_JoystickRumbleTriggers() and SDL_GameControllerRumbleTriggers()
This commit is contained in:
parent
067630aef3
commit
1e2caac58b
28 changed files with 326 additions and 10 deletions
|
@ -1071,6 +1071,23 @@ HIDAPI_JoystickRumble(SDL_Joystick * joystick, Uint16 low_frequency_rumble, Uint
|
|||
return result;
|
||||
}
|
||||
|
||||
static int
|
||||
HIDAPI_JoystickRumbleTriggers(SDL_Joystick * joystick, Uint16 left_rumble, Uint16 right_rumble)
|
||||
{
|
||||
int result;
|
||||
|
||||
if (joystick->hwdata) {
|
||||
SDL_HIDAPI_Device *device = joystick->hwdata->device;
|
||||
|
||||
result = device->driver->RumbleJoystickTriggers(device, joystick, left_rumble, right_rumble);
|
||||
} else {
|
||||
SDL_SetError("Rumble failed, device disconnected");
|
||||
result = -1;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static SDL_bool
|
||||
HIDAPI_JoystickHasLED(SDL_Joystick * joystick)
|
||||
{
|
||||
|
@ -1175,6 +1192,7 @@ SDL_JoystickDriver SDL_HIDAPI_JoystickDriver =
|
|||
HIDAPI_JoystickGetDeviceInstanceID,
|
||||
HIDAPI_JoystickOpen,
|
||||
HIDAPI_JoystickRumble,
|
||||
HIDAPI_JoystickRumbleTriggers,
|
||||
HIDAPI_JoystickHasLED,
|
||||
HIDAPI_JoystickSetLED,
|
||||
HIDAPI_JoystickUpdate,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue