Fix build on legacy MinGW

master
Camilla Berglund ago%!(EXTRA string=9 years)
parent bd345164d3
commit 135ed7feb4
  1. 8
      src/win32_joystick.c
  2. 1
      src/win32_platform.h

@ -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;

@ -64,6 +64,7 @@
// GLFW uses DirectInput8 interfaces
#define DIRECTINPUT_VERSION 0x0800
#include <wctype.h>
#include <windows.h>
#include <mmsystem.h>
#include <dinput.h>

Loading…
Cancel
Save