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.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/rendering/renderer.h b/src/rendering/renderer.h
index dd4c259..6212b21 100644
--- a/src/rendering/renderer.h
+++ b/src/rendering/renderer.h
@@ -1,10 +1,10 @@
#pragma once
+#include "core/memory.h"
#include "vertex_array.h"
#include "shader.h"
#include <glm/glm.hpp>
-#include <memory>
namespace Donut
{
@@ -28,12 +28,12 @@ namespace Donut
virtual void enable_depth_test() = 0;
virtual void set_face_culling(bool enabled) = 0;
- virtual void draw_indexed(const std::shared_ptr<VertexArray>& vertex_array,
+ virtual void draw_indexed(const Ref<VertexArray>& vertex_array,
uint32_t index_count = 0) = 0;
inline static API get_api() { return s_api; }
inline static void set_api(API api) { s_api = api; }
- static std::unique_ptr<RendererAPI> create();
+ static Scope<RendererAPI> create();
private:
static API s_api;
};
@@ -71,13 +71,13 @@ namespace Donut
s_renderer_api->set_face_culling(enabled);
}
- inline static void draw_indexed(const std::shared_ptr<VertexArray>& vertex_array, uint32_t index_count = 0)
+ inline static void draw_indexed(const Ref<VertexArray>& vertex_array, uint32_t index_count = 0)
{
s_renderer_api->draw_indexed(vertex_array, index_count);
}
private:
- static std::unique_ptr<RendererAPI> s_renderer_api;
+ static Scope<RendererAPI> s_renderer_api;
};
class Renderer
@@ -88,8 +88,8 @@ namespace Donut
static void on_window_resize(uint32_t width, uint32_t height);
- static void submit(const std::shared_ptr<Shader>& shader,
- const std::shared_ptr<VertexArray>& vertex_array,
+ static void submit(const Ref<Shader>& shader,
+ const Ref<VertexArray>& vertex_array,
const glm::mat4& transform,
const glm::mat4& view_projection);