shithub: cstory

Download patch

ref: cb869a4fd1152749fae38bc5307df00a561f56bf
parent: f5480444641f82be6b6c4234e757fffb2afe5dbd
author: Clownacy <Clownacy@users.noreply.github.com>
date: Fri Apr 3 14:13:44 EDT 2020

Support GLFW <3.3

Travis's Ubuntu Bionic uses 3.2, causing it to fail.

--- a/src/Backends/GLFW3/Controller.cpp
+++ b/src/Backends/GLFW3/Controller.cpp
@@ -27,7 +27,11 @@
 
 	for (int i = GLFW_JOYSTICK_1; i < GLFW_JOYSTICK_LAST; ++i)
 	{
+#if GLFW_VERSION_MAJOR > 3 || (GLFW_VERSION_MAJOR == 3 && GLFW_VERSION_MINOR >= 3)
 		if (glfwJoystickPresent(i) == GLFW_TRUE && glfwJoystickIsGamepad(i) == GLFW_TRUE)
+#else
+		if (glfwJoystickPresent(i) == GLFW_TRUE)
+#endif
 		{
 			printf("Joystick #%d selected\n", i);
 			joystick_connected = TRUE;
@@ -44,7 +48,11 @@
 	if (!joystick_connected)
 		return FALSE;
 
+#if GLFW_VERSION_MAJOR > 3 || (GLFW_VERSION_MAJOR == 3 && GLFW_VERSION_MINOR >= 3)
 	if (glfwJoystickPresent(connected_joystick_id) == GLFW_FALSE || glfwJoystickIsGamepad(connected_joystick_id) == GLFW_FALSE)
+#else
+	if (glfwJoystickPresent(connected_joystick_id) == GLFW_FALSE)
+#endif
 		return FALSE;
 
 	int total_axis;
@@ -75,7 +83,11 @@
 	if (!joystick_connected)
 		return FALSE;
 
+#if GLFW_VERSION_MAJOR > 3 || (GLFW_VERSION_MAJOR == 3 && GLFW_VERSION_MINOR >= 3)
 	if (glfwJoystickPresent(connected_joystick_id) == GLFW_FALSE || glfwJoystickIsGamepad(connected_joystick_id) == GLFW_FALSE)
+#else
+	if (glfwJoystickPresent(connected_joystick_id) == GLFW_FALSE)
+#endif
 		return FALSE;
 
 	int total_axis;