core: rename mbgl directories to mln (#4511)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
38
include/mln/gfx/backend_scope.hpp
Normal file
38
include/mln/gfx/backend_scope.hpp
Normal file
@@ -0,0 +1,38 @@
|
||||
#pragma once
|
||||
|
||||
namespace mln {
|
||||
namespace gfx {
|
||||
|
||||
class RendererBackend;
|
||||
|
||||
class BackendScope {
|
||||
public:
|
||||
/// There are two types of scopes: Creating an "Implicit" scope tells MapLibre
|
||||
/// Native that the supporting windowing system has already activated the
|
||||
/// RenderBackend and that no further actions are required. Creating an "Explicit"
|
||||
/// scope (the default) actually enables the RenderBackend, 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:
|
||||
void activate();
|
||||
void deactivate();
|
||||
|
||||
BackendScope* priorScope;
|
||||
BackendScope* nextScope;
|
||||
RendererBackend& backend;
|
||||
const ScopeType scopeType;
|
||||
bool activated = false;
|
||||
};
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace mln
|
||||
Reference in New Issue
Block a user