diff --git a/include/mbgl/platform/default/glx.h b/include/mbgl/platform/default/glx.h deleted file mode 100644 index 6b7d9a3df..000000000 --- a/include/mbgl/platform/default/glx.h +++ /dev/null @@ -1,2 +0,0 @@ -#include -#undef None diff --git a/include/mbgl/platform/default/headless_view.hpp b/include/mbgl/platform/default/headless_view.hpp index 2fad430e6..ba318c2b4 100644 --- a/include/mbgl/platform/default/headless_view.hpp +++ b/include/mbgl/platform/default/headless_view.hpp @@ -5,9 +5,12 @@ #define MBGL_USE_CGL 1 #else #define GL_GLEXT_PROTOTYPES -#include #define MBGL_USE_GLX 1 -#undef Status +typedef struct _XDisplay Display; +typedef struct __GLXcontextRec* GLXContext; +typedef struct __GLXFBConfigRec* GLXFBConfig; +typedef long unsigned int XID; +typedef XID GLXPbuffer; #endif #include diff --git a/platform/default/headless_display.cpp b/platform/default/headless_display.cpp index 4756c8d2c..c4535fc1a 100644 --- a/platform/default/headless_display.cpp +++ b/platform/default/headless_display.cpp @@ -3,6 +3,10 @@ #include #include +#if MBGL_USE_GLX +#include +#endif + namespace mbgl { HeadlessDisplay::HeadlessDisplay() { @@ -52,7 +56,7 @@ HeadlessDisplay::HeadlessDisplay() { // We're creating a dummy pbuffer anyway that we're not using. static int pixelFormat[] = { GLX_DRAWABLE_TYPE, GLX_PBUFFER_BIT, - 0 + None }; int configs = 0; diff --git a/platform/default/headless_view.cpp b/platform/default/headless_view.cpp index 9df58f802..656a77439 100644 --- a/platform/default/headless_view.cpp +++ b/platform/default/headless_view.cpp @@ -28,6 +28,8 @@ CGLProc CGLGetProcAddress(const char *proc) { CFRelease(name); return symbol; } +#elif MBGL_USE_GLX +#include #endif namespace mbgl { @@ -104,7 +106,7 @@ void HeadlessView::createContext() { if (!glContext) { // Try to create a legacy context - glContext = glXCreateNewContext(xDisplay, fbConfigs[0], GLX_RGBA_TYPE, 0, True); + glContext = glXCreateNewContext(xDisplay, fbConfigs[0], GLX_RGBA_TYPE, None, True); if (glContext) { if (!glXIsDirect(xDisplay, glContext)) { mbgl::Log::Error(mbgl::Event::OpenGL, "Failed to create direct OpenGL Legacy context"); @@ -123,7 +125,7 @@ void HeadlessView::createContext() { int pbufferAttributes[] = { GLX_PBUFFER_WIDTH, 8, GLX_PBUFFER_HEIGHT, 8, - 0 + None }; glxPbuffer = glXCreatePbuffer(xDisplay, fbConfigs[0], pbufferAttributes); #endif