diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/mbgl/platform/default/headless_view.hpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/include/mbgl/platform/default/headless_view.hpp b/include/mbgl/platform/default/headless_view.hpp index 8347aa51fe..edaa08d01d 100644 --- a/include/mbgl/platform/default/headless_view.hpp +++ b/include/mbgl/platform/default/headless_view.hpp @@ -2,7 +2,12 @@ #define MBGL_COMMON_HEADLESS_VIEW #ifdef __APPLE__ +#include <TargetConditionals.h> +#if TARGET_OS_IOS +#define MBGL_USE_EAGL 1 +#else #define MBGL_USE_CGL 1 +#endif #else #define GL_GLEXT_PROTOTYPES #define MBGL_USE_GLX 1 @@ -45,11 +50,17 @@ public: void resize(uint16_t width, uint16_t height); private: - void createContext(); void loadExtensions(); - void clearBuffers(); bool isActive() const; + // Implementation specific functions + static gl::glProc initializeExtension(const char*); + void createContext(); + void destroyContext(); + void clearBuffers(); + void activateContext(); + void deactivateContext(); + private: std::shared_ptr<HeadlessDisplay> display; const float pixelRatio; @@ -60,6 +71,10 @@ private: CGLContextObj glContext = nullptr; #endif +#if MBGL_USE_EAGL + void *glContext = nullptr; +#endif + #if MBGL_USE_GLX Display *xDisplay = nullptr; GLXFBConfig *fbConfigs = nullptr; |