From b6398c58b476fd9577799c1b1695608fde0a36af Mon Sep 17 00:00:00 2001 From: Clownacy Date: Sun, 5 Apr 2020 03:24:55 +0100 Subject: [PATCH] Disable GLFW hats in <3.3 Doesn't exist - causes Travis to fail --- src/Backends/GLFW3/Controller.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Backends/GLFW3/Controller.cpp b/src/Backends/GLFW3/Controller.cpp index 8abd138e..b5c55dc2 100644 --- a/src/Backends/GLFW3/Controller.cpp +++ b/src/Backends/GLFW3/Controller.cpp @@ -102,8 +102,10 @@ BOOL ControllerBackend_GetJoystickStatus(JOYSTICK_STATUS *status) int total_axes; const float *axes = glfwGetJoystickAxes(connected_joystick_id, &total_axes); +#if GLFW_VERSION_MAJOR > 3 || (GLFW_VERSION_MAJOR == 3 && GLFW_VERSION_MINOR >= 3) int total_hats; const unsigned char *hats = glfwGetJoystickHats(connected_joystick_id, &total_hats); +#endif // Handle directional inputs status->bLeft = axes[0] < axis_neutrals[0] - DEADZONE; @@ -137,6 +139,7 @@ BOOL ControllerBackend_GetJoystickStatus(JOYSTICK_STATUS *status) break; } +#if GLFW_VERSION_MAJOR > 3 || (GLFW_VERSION_MAJOR == 3 && GLFW_VERSION_MINOR >= 3) // Then the joystick hats for (int i = 0; i < total_axes; ++i) { @@ -160,6 +163,7 @@ BOOL ControllerBackend_GetJoystickStatus(JOYSTICK_STATUS *status) if (++buttons_done >= button_limit) break; } +#endif // Blank any remaining buttons for (size_t i = buttons_done; i < button_limit; ++i)