summaryrefslogtreecommitdiff
path: root/include/mbgl/platform
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2016-02-17 18:23:23 +0100
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-03-22 11:56:01 -0700
commit61920071cd221d0d0627e01893185f0f19b55a98 (patch)
treee07358ba8bc9867ae979fd958d4eed3a7164230a /include/mbgl/platform
parent1dd81d9776baf9b9ef61b05d29f7acbb0f2a1508 (diff)
downloadqtlocation-mapboxgl-61920071cd221d0d0627e01893185f0f19b55a98.tar.gz
[core] split headless_view.cpp into implementation-specific files
also adds a EAGL implementation for iOS
Diffstat (limited to 'include/mbgl/platform')
-rw-r--r--include/mbgl/platform/default/headless_view.hpp19
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;