summaryrefslogtreecommitdiff
path: root/include/mbgl/map/backend.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/mbgl/map/backend.hpp')
-rw-r--r--include/mbgl/map/backend.hpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/mbgl/map/backend.hpp b/include/mbgl/map/backend.hpp
index cd756abe43..876c19261b 100644
--- a/include/mbgl/map/backend.hpp
+++ b/include/mbgl/map/backend.hpp
@@ -3,11 +3,13 @@
#include <mbgl/map/map_observer.hpp>
#include <memory>
+#include <mutex>
namespace mbgl {
namespace gl {
class Context;
+using ProcAddress = void (*)();
} // namespace gl
class BackendScope;
@@ -25,6 +27,11 @@ public:
virtual void invalidate() = 0;
protected:
+ // Called with the name of an OpenGL extension that should be loaded. Backend implementations
+ // must call the API-specific version that obtains the function pointer for this function,
+ // or a null pointer if unsupported/unavailable.
+ virtual gl::ProcAddress initializeExtension(const char*) = 0;
+
// Called when the backend's GL context needs to be made active or inactive. These are called,
// as a matched pair, in four situations:
//
@@ -38,8 +45,12 @@ protected:
virtual void activate() = 0;
virtual void deactivate() = 0;
+protected:
std::unique_ptr<gl::Context> context;
+private:
+ std::once_flag initialized;
+
friend class BackendScope;
};