hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/src/rendering/renderer.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/rendering/renderer.h')
-rw-r--r--src/rendering/renderer.h17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/rendering/renderer.h b/src/rendering/renderer.h
index c7ace3c..dd4c259 100644
--- a/src/rendering/renderer.h
+++ b/src/rendering/renderer.h
@@ -2,20 +2,12 @@
#include "vertex_array.h"
#include "shader.h"
+
#include <glm/glm.hpp>
#include <memory>
namespace Donut
{
- template<typename T>
- using Scope = std::unique_ptr<T>;
-
- template<typename T, typename ... Args>
- constexpr Scope<T> create_scope(Args&& ... args)
- {
- return std::make_unique<T>(std::forward<Args>(args)...);
- }
-
class RendererAPI
{
public:
@@ -39,8 +31,9 @@ namespace Donut
virtual void draw_indexed(const std::shared_ptr<VertexArray>& vertex_array,
uint32_t index_count = 0) = 0;
- inline static API get_api() { return s_api; }
- static Scope<RendererAPI> create();
+ inline static API get_api() { return s_api; }
+ inline static void set_api(API api) { s_api = api; }
+ static std::unique_ptr<RendererAPI> create();
private:
static API s_api;
};
@@ -84,7 +77,7 @@ namespace Donut
}
private:
- static Scope<RendererAPI> s_renderer_api;
+ static std::unique_ptr<RendererAPI> s_renderer_api;
};
class Renderer