Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/joystick/windows/SDL_windowsjoystick.c
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,9 @@ static bool WINDOWS_JoystickOpen(SDL_Joystick *joystick, int device_index)

static bool WINDOWS_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble)
{
if (!joystick->hwdata) {
return SDL_SetError("Rumble failed, device disconnected.");
}
#ifdef SDL_JOYSTICK_XINPUT
if (joystick->hwdata->bXInputDevice) {
return SDL_XINPUT_JoystickRumble(joystick, low_frequency_rumble, high_frequency_rumble);
Expand Down Expand Up @@ -629,6 +632,10 @@ static void WINDOWS_JoystickUpdate(SDL_Joystick *joystick)
// Function to close a joystick after use
static void WINDOWS_JoystickClose(SDL_Joystick *joystick)
{
if (!joystick->hwdata) {
SDL_SetError("Unable to close joystick, hwdata is NULL.");
return;
}
#ifdef SDL_JOYSTICK_XINPUT
if (joystick->hwdata->bXInputDevice) {
SDL_XINPUT_JoystickClose(joystick);
Expand Down
Loading