Added support for old versions of 'glfw3native.h', fixes #13

This commit is contained in:
Jarcode
2018-02-06 18:22:17 -08:00
parent 8359ad9a98
commit 1e2aad05b5
2 changed files with 6 additions and 1 deletions

View File

@@ -19,7 +19,7 @@ You can pass `BUILD=debug` to the makefile for debug builds of both glad and gla
- X11 - X11
- PulseAudio - PulseAudio
- GLFW 3.2+ - GLFW 3.1+
- Linux or BSD - Linux or BSD
**Additional compile time requirements:** **Additional compile time requirements:**

5
xwin.c
View File

@@ -16,6 +16,11 @@
#include <X11/extensions/XShm.h> #include <X11/extensions/XShm.h>
#define GLFW_EXPOSE_NATIVE_X11 #define GLFW_EXPOSE_NATIVE_X11
/* Hack to make GLFW 3.1 headers work with GLava. We don't use the context APIs from GLFW, but
the old headers require one of them to be selected for exposure in glfw3native.h. */
#if (GLFW_VERSION_MAJOR == 3 && GLFW_VERSION_MINOR <= 1)
#define GLFW_EXPOSE_NATIVE_GLX
#endif
#include <glad/glad.h> #include <glad/glad.h>
#include <GLFW/glfw3.h> #include <GLFW/glfw3.h>
#include <GLFW/glfw3native.h> #include <GLFW/glfw3native.h>