From 93bbb30e026c050f33902ab31f3ac066a215138a Mon Sep 17 00:00:00 2001 From: cochrane Date: Fri, 18 Nov 2016 17:29:52 +0100 Subject: [PATCH] Fix project not compiling on OS X 10.11.6. As the comment says: In Compatibility mode (used by including gl.h instead of gl3.h), OS X only supports OpenGL 2 with some extensions. VAOs, which are an OpenGL 3 feature, are not available under their OpenGL 3 name. Instead they are exposed through an Apple-specific extension that works identically in all respects that matter. With this, it is possible to build and run the program without any trouble. --- src/core.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/core.h b/src/core.h index 21c35928..30c7897e 100644 --- a/src/core.h +++ b/src/core.h @@ -18,6 +18,14 @@ #include #include #include +/* + * In compatibility mode, Mac OS X only supports OpenGL 2 (no VAO), but it does + * support the Apple-specific VAO extension which is older and in all relevant + * parts 100% compatible. So use those functions instead. + */ +#define glBindVertexArray glBindVertexArrayAPPLE +#define glGenVertexArrays glGenVertexArraysAPPLE +#define glDeleteVertexArrays glDeleteVertexArraysAPPLE #elif __EMSCRIPTEN__ #define MOBILE 1 #include