Gamepad rumble support with SDL2 (#3819)

* Added gamepad rumble to rcore_desktop.c and rcore_desktop_sdl.c
Still need to add to the rest of the platforms.

* Add SetGamepadVibration warnings to unimplemented platforms.

* Added MAX_GAMEPAD_VIBRATION_TIME
The rumble in SDL2 will continue for MAX_GAMEPAD_VIBRATION_TIME unless the user cancels it with a call to SetGamepadVibration(0.0f,0.0f,0.0f)

* Cast float duration value to Uint 32

* Changed defines from int to float and fixed typo

---------

Co-authored-by: Gideon Serfontein <gse@newspacesystems.com>
This commit is contained in:
GideonSerf 2024-02-24 17:47:27 +02:00 committed by GitHub
parent bda919033d
commit 371d25c8c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 54 additions and 10 deletions

View file

@ -519,6 +519,12 @@ int SetGamepadMappings(const char *mappings)
return 0;
}
// Set gamepad vibration
void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor)
{
TRACELOG(LOG_WARNING, "GamepadSetVibration() not implemented on target platform");
}
// Set mouse position XY
void SetMousePosition(int x, int y)
{