summaryrefslogtreecommitdiffhomepage
path: root/src/rcore.c
diff options
context:
space:
mode:
authorGideonSerf <[email protected]>2024-02-24 17:47:27 +0200
committerGitHub <[email protected]>2024-02-24 16:47:27 +0100
commit371d25c8c99f6db487c938f8b7f391d45e26d3a4 (patch)
treebc4600ada3abc9f74420e3d00b36a3b38ccd22f5 /src/rcore.c
parentbda919033dfdd2d0d75b606f3fa29d21f0408ffb (diff)
downloadraylib-371d25c8c99f6db487c938f8b7f391d45e26d3a4.tar.gz
raylib-371d25c8c99f6db487c938f8b7f391d45e26d3a4.zip
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 <[email protected]>
Diffstat (limited to 'src/rcore.c')
-rw-r--r--src/rcore.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/rcore.c b/src/rcore.c
index f4abe117..024f0d12 100644
--- a/src/rcore.c
+++ b/src/rcore.c
@@ -224,6 +224,9 @@ __declspec(dllimport) int __stdcall WideCharToMultiByte(unsigned int cp, unsigne
#ifndef MAX_GAMEPAD_BUTTONS
#define MAX_GAMEPAD_BUTTONS 32 // Maximum number of buttons supported (per gamepad)
#endif
+#ifndef MAX_GAMEPAD_VIBRATION_TIME
+ #define MAX_GAMEPAD_VIBRATION_TIME 2.0f // Maximum vibration time in seconds
+#endif
#ifndef MAX_TOUCH_POINTS
#define MAX_TOUCH_POINTS 8 // Maximum number of touch points supported
#endif