summaryrefslogtreecommitdiff
path: root/src/mbgl/gfx/context.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/gfx/context.hpp')
-rw-r--r--src/mbgl/gfx/context.hpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/mbgl/gfx/context.hpp b/src/mbgl/gfx/context.hpp
index f98b2266f4..90b62c94a4 100644
--- a/src/mbgl/gfx/context.hpp
+++ b/src/mbgl/gfx/context.hpp
@@ -6,14 +6,21 @@
#include <mbgl/gfx/index_buffer.hpp>
#include <mbgl/gfx/texture.hpp>
#include <mbgl/gfx/draw_scope.hpp>
+#include <mbgl/gfx/program.hpp>
#include <mbgl/gfx/types.hpp>
namespace mbgl {
+
+class ProgramParameters;
+
namespace gfx {
class Context {
protected:
- Context() = default;
+ Context(ContextType type_) : backend(type_) {
+ }
+
+ const ContextType backend;
public:
Context(Context&&) = delete;
@@ -98,6 +105,14 @@ public:
protected:
virtual std::unique_ptr<DrawScopeResource> createDrawScopeResource() = 0;
+
+public:
+ template <typename Name>
+ std::unique_ptr<Program<Name>> createProgram(const ProgramParameters&);
+
+private:
+ template <typename Backend, typename Name>
+ std::unique_ptr<Program<Name>> createProgram(const ProgramParameters&);
};
} // namespace gfx