diff --git a/src/win32_joystick.c b/src/win32_joystick.c index 43336a31..0268e051 100644 --- a/src/win32_joystick.c +++ b/src/win32_joystick.c @@ -603,9 +603,9 @@ static GLFWbool pollJoystickState(_GLFWjoystickWin32* js, int mode) if (mode == _GLFW_PRESENCE_ONLY) return GLFW_TRUE; - if (sqrtf((float) (xis.Gamepad.sThumbLX * xis.Gamepad.sThumbLX + + if (sqrt((double) (xis.Gamepad.sThumbLX * xis.Gamepad.sThumbLX + xis.Gamepad.sThumbLY * xis.Gamepad.sThumbLY)) > - (float) XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE) + (double) XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE) { js->axes[0] = (xis.Gamepad.sThumbLX + 0.5f) / 32767.f; js->axes[1] = (xis.Gamepad.sThumbLY + 0.5f) / 32767.f; @@ -616,9 +616,9 @@ static GLFWbool pollJoystickState(_GLFWjoystickWin32* js, int mode) js->axes[1] = 0.f; } - if (sqrtf((float) (xis.Gamepad.sThumbRX * xis.Gamepad.sThumbRX + + if (sqrt((double) (xis.Gamepad.sThumbRX * xis.Gamepad.sThumbRX + xis.Gamepad.sThumbRY * xis.Gamepad.sThumbRY)) > - (float) XINPUT_GAMEPAD_RIGHT_THUMB_DEADZONE) + (double) XINPUT_GAMEPAD_RIGHT_THUMB_DEADZONE) { js->axes[2] = (xis.Gamepad.sThumbRX + 0.5f) / 32767.f; js->axes[3] = (xis.Gamepad.sThumbRY + 0.5f) / 32767.f; diff --git a/src/win32_platform.h b/src/win32_platform.h index d0dac96d..d44ca3b9 100644 --- a/src/win32_platform.h +++ b/src/win32_platform.h @@ -64,6 +64,7 @@ // GLFW uses DirectInput8 interfaces #define DIRECTINPUT_VERSION 0x0800 +#include #include #include #include