summaryrefslogtreecommitdiff
path: root/common/headless_display.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/headless_display.hpp')
-rw-r--r--common/headless_display.hpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/common/headless_display.hpp b/common/headless_display.hpp
new file mode 100644
index 0000000000..4fc03da083
--- /dev/null
+++ b/common/headless_display.hpp
@@ -0,0 +1,32 @@
+#ifndef MBGL_COMMON_HEADLESS_DISPLAY
+#define MBGL_COMMON_HEADLESS_DISPLAY
+
+#ifdef __APPLE__
+#define MBGL_USE_CGL 1
+#else
+#include <GL/glx.h>
+#define MBGL_USE_GLX 1
+#endif
+
+#include <mbgl/platform/gl.hpp>
+
+namespace mbgl {
+
+class HeadlessDisplay {
+public:
+ HeadlessDisplay();
+ ~HeadlessDisplay();
+
+#if MBGL_USE_CGL
+ CGLPixelFormatObj pixelFormat;
+#endif
+
+#if MBGL_USE_GLX
+ Display *x_display = nullptr;
+ XVisualInfo *x_info = nullptr;
+#endif
+};
+
+}
+
+#endif