diff --git a/src/SFML/Window/Win32/Joystick.cpp b/src/SFML/Window/Win32/Joystick.cpp index 5dcaecdd..10bb0d67 100644 --- a/src/SFML/Window/Win32/Joystick.cpp +++ b/src/SFML/Window/Win32/Joystick.cpp @@ -49,6 +49,8 @@ void Joystick::Initialize(unsigned int Index) // Get the Index-th connected joystick MMRESULT Error; JOYINFOEX JoyInfo; + JoyInfo.dwSize = sizeof(JoyInfo); + JoyInfo.dwFlags = JOY_RETURNALL; for (unsigned int NbFound = 0; (Error = joyGetPosEx(myIndex, &JoyInfo)) != JOYERR_PARMS; myIndex++) { // Check if the current joystick is connected