wrap GL/glx.h with undef None, use 0 instead, h/t @jfirebaugh

This commit is contained in:
Mike Morris
2014-10-06 16:53:57 -04:00
parent 170ce422ce
commit 8b06b65f35
4 changed files with 5 additions and 3 deletions

2
common/glx.h Normal file
View File

@@ -0,0 +1,2 @@
#include <GL/glx.h>
#undef None

View File

@@ -39,7 +39,7 @@ HeadlessDisplay::HeadlessDisplay() {
GLX_ALPHA_SIZE, 8,
GLX_DEPTH_SIZE, 24,
GLX_STENCIL_SIZE, 8,
None
0
};
x_info = glXChooseVisual(x_display, DefaultScreen(x_display), pixelFormat);

View File

@@ -171,7 +171,7 @@ void HeadlessView::make_inactive() {
#endif
#if MBGL_USE_GLX
if (!glXMakeCurrent(x_display, None, NULL)) {
if (!glXMakeCurrent(x_display, 0, NULL)) {
fprintf(stderr, "Removing OpenGL context failed\n");
}
#endif

View File

@@ -4,7 +4,7 @@
#ifdef __APPLE__
#define MBGL_USE_CGL 1
#else
#include <GL/glx.h>
#include "glx.h"
#define MBGL_USE_GLX 1
#endif