summaryrefslogtreecommitdiffhomepage
path: root/src/raylib.h
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/raylib.h
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/raylib.h')
-rw-r--r--src/raylib.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/raylib.h b/src/raylib.h
index 7cf4e653..d857f1c7 100644
--- a/src/raylib.h
+++ b/src/raylib.h
@@ -1162,16 +1162,17 @@ RLAPI int GetCharPressed(void); // Get char presse
RLAPI void SetExitKey(int key); // Set a custom key to exit program (default is ESC)
// Input-related functions: gamepads
-RLAPI bool IsGamepadAvailable(int gamepad); // Check if a gamepad is available
-RLAPI const char *GetGamepadName(int gamepad); // Get gamepad internal name id
-RLAPI bool IsGamepadButtonPressed(int gamepad, int button); // Check if a gamepad button has been pressed once
-RLAPI bool IsGamepadButtonDown(int gamepad, int button); // Check if a gamepad button is being pressed
-RLAPI bool IsGamepadButtonReleased(int gamepad, int button); // Check if a gamepad button has been released once
-RLAPI bool IsGamepadButtonUp(int gamepad, int button); // Check if a gamepad button is NOT being pressed
-RLAPI int GetGamepadButtonPressed(void); // Get the last gamepad button pressed
-RLAPI int GetGamepadAxisCount(int gamepad); // Get gamepad axis count for a gamepad
-RLAPI float GetGamepadAxisMovement(int gamepad, int axis); // Get axis movement value for a gamepad axis
-RLAPI int SetGamepadMappings(const char *mappings); // Set internal gamepad mappings (SDL_GameControllerDB)
+RLAPI bool IsGamepadAvailable(int gamepad); // Check if a gamepad is available
+RLAPI const char *GetGamepadName(int gamepad); // Get gamepad internal name id
+RLAPI bool IsGamepadButtonPressed(int gamepad, int button); // Check if a gamepad button has been pressed once
+RLAPI bool IsGamepadButtonDown(int gamepad, int button); // Check if a gamepad button is being pressed
+RLAPI bool IsGamepadButtonReleased(int gamepad, int button); // Check if a gamepad button has been released once
+RLAPI bool IsGamepadButtonUp(int gamepad, int button); // Check if a gamepad button is NOT being pressed
+RLAPI int GetGamepadButtonPressed(void); // Get the last gamepad button pressed
+RLAPI int GetGamepadAxisCount(int gamepad); // Get gamepad axis count for a gamepad
+RLAPI float GetGamepadAxisMovement(int gamepad, int axis); // Get axis movement value for a gamepad axis
+RLAPI int SetGamepadMappings(const char *mappings); // Set internal gamepad mappings (SDL_GameControllerDB)
+RLAPI void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor); // Set gamepad vibration for both motors
// Input-related functions: mouse
RLAPI bool IsMouseButtonPressed(int button); // Check if a mouse button has been pressed once