Made XInput2 optional at compile-time.

This is required for RHEL 5, CentOS 5 and Cygwin-X.

Fixes #314.
This commit is contained in:
Camilla Berglund
2015-01-27 23:48:29 +01:00
parent 93855ae6ab
commit f4c127f75a
7 changed files with 40 additions and 22 deletions
+4
View File
@@ -412,6 +412,7 @@ static GLboolean createWindow(_GLFWwindow* window,
XFree(hint);
}
#if defined(_GLFW_HAS_XINPUT)
if (_glfw.x11.xi.available)
{
// Select for XInput2 events
@@ -426,6 +427,7 @@ static GLboolean createWindow(_GLFWwindow* window,
XISelectEvents(_glfw.x11.display, window->x11.handle, &eventmask, 1);
}
#endif /*_GLFW_HAS_XINPUT*/
if (_glfw.x11.XdndAware)
{
@@ -1310,6 +1312,7 @@ static void processEvent(XEvent *event)
case DestroyNotify:
return;
#if defined(_GLFW_HAS_XINPUT)
case GenericEvent:
{
if (event->xcookie.extension == _glfw.x11.xi.majorOpcode &&
@@ -1355,6 +1358,7 @@ static void processEvent(XEvent *event)
XFreeEventData(_glfw.x11.display, &event->xcookie);
break;
}
#endif /*_GLFW_HAS_XINPUT*/
default:
{