summaryrefslogtreecommitdiff
path: root/include/mbgl/renderer/backend_scope.hpp
diff options
context:
space:
mode:
authorIvo van Dongen <info@ivovandongen.nl>2017-07-05 20:08:51 +0300
committerIvo van Dongen <ivovandongen@users.noreply.github.com>2017-07-18 10:45:12 +0200
commit46c43510d7ac5fe078010d5f0f5d39c4d5df3305 (patch)
tree5dc78959e174dc0e83198a4d92e86f65f33bb168 /include/mbgl/renderer/backend_scope.hpp
parentee205ca9ca3f808fa2cc16295ebde0a7c3867381 (diff)
downloadqtlocation-mapboxgl-46c43510d7ac5fe078010d5f0f5d39c4d5df3305.tar.gz
[core] rename backend to renderer backend
Diffstat (limited to 'include/mbgl/renderer/backend_scope.hpp')
-rw-r--r--include/mbgl/renderer/backend_scope.hpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/include/mbgl/renderer/backend_scope.hpp b/include/mbgl/renderer/backend_scope.hpp
new file mode 100644
index 0000000000..f8a258f3df
--- /dev/null
+++ b/include/mbgl/renderer/backend_scope.hpp
@@ -0,0 +1,31 @@
+#pragma once
+
+namespace mbgl {
+
+class RendererBackend;
+
+class BackendScope {
+public:
+ // There are two types of scopes: Creating an "Implicit" scope tells Mapbox GL that the
+ // supporting windowing system has already activated the GL Backend and that no further actions
+ // are required. Creating an "Explicit" scope actually enables the GL Backend, and disables it
+ // when the BackendScope is destroyed.
+ enum class ScopeType : bool {
+ Implicit,
+ Explicit,
+ };
+
+ BackendScope(RendererBackend&, ScopeType = ScopeType::Explicit);
+ ~BackendScope();
+
+ // Returns true when there is currently a BackendScope active in this thread.
+ static bool exists();
+
+private:
+ BackendScope* priorScope;
+ BackendScope* nextScope;
+ RendererBackend& backend;
+ const ScopeType scopeType;
+};
+
+} // namespace mbgl