Added gamepad rumble to rcore_desktop.c and rcore_desktop_sdl.c
Still need to add to the rest of the platforms.
This commit is contained in:
parent
23616153d4
commit
e577614a04
|
|
@ -1050,6 +1050,12 @@ int SetGamepadMappings(const char *mappings)
|
|||
return glfwUpdateGamepadMappings(mappings);
|
||||
}
|
||||
|
||||
// Set gamepad vibration
|
||||
void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor, float durationMs)
|
||||
{
|
||||
TRACELOG(LOG_WARNING, "GamepadSetVibration() not available on target platform");
|
||||
}
|
||||
|
||||
// Set mouse position XY
|
||||
void SetMousePosition(int x, int y)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -938,6 +938,15 @@ int SetGamepadMappings(const char *mappings)
|
|||
return SDL_GameControllerAddMapping(mappings);
|
||||
}
|
||||
|
||||
// Set gamepad vibration
|
||||
void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor, float durationMs)
|
||||
{
|
||||
if (IsGamepadAvailable(gamepad))
|
||||
{
|
||||
SDL_JoystickRumble(platform.gamepad[gamepad], (Uint16)(leftMotor*0xFFFF), (Uint16)(rightMotor*0xFFFF), durationMs);
|
||||
}
|
||||
}
|
||||
|
||||
// Set mouse position XY
|
||||
void SetMousePosition(int x, int y)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1172,6 +1172,7 @@ RLAPI int GetGamepadButtonPressed(void); // Get the last ga
|
|||
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, float durationMs); // Set gamepad vibration for both motors
|
||||
|
||||
// Input-related functions: mouse
|
||||
RLAPI bool IsMouseButtonPressed(int button); // Check if a mouse button has been pressed once
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user