Skip to content

Commit

Permalink
Merge pull request #85 from Lwmte/master
Browse files Browse the repository at this point in the history
Fix Win32 build without XInput support
  • Loading branch information
Ybalrid authored Jul 18, 2022
2 parents e0513db + 16d680f commit 59a0529
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/win32/Win32ForceFeedback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@ bool Win32ForceFeedback::_isXInput()
//--------------------------------------------------------------//
void Win32ForceFeedback::_setXInputVibration(unsigned short leftPower, unsigned short rightPower)
{
#ifdef OIS_WIN32_XINPUT_SUPPORT
XINPUT_STATE state;
if(XInputGetState(mXInputIndex, &state) == ERROR_DEVICE_NOT_CONNECTED)
return;
Expand All @@ -522,6 +523,7 @@ void Win32ForceFeedback::_setXInputVibration(unsigned short leftPower, unsigned

if(XInputSetState((DWORD)mXInputIndex, &vibration) != ERROR_SUCCESS)
OIS_EXCEPT(E_General, "Error updating XInput device vibration!");
#endif
}

//--------------------------------------------------------------//
Expand Down

0 comments on commit 59a0529

Please sign in to comment.