diff options
Diffstat (limited to 'src/rendering/renderer.h')
| -rw-r--r-- | src/rendering/renderer.h | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/src/rendering/renderer.h b/src/rendering/renderer.h index fd61914..09e9521 100644 --- a/src/rendering/renderer.h +++ b/src/rendering/renderer.h @@ -33,6 +33,7 @@ namespace Donut virtual void set_viewport(uint32_t x, uint32_t y, uint32_t width, uint32_t height) = 0; virtual void set_clear_color(const glm::vec4& color) = 0; virtual void clear() = 0; + virtual void enable_depth_test() = 0; virtual void draw_indexed(const std::shared_ptr<VertexArray>& vertex_array, uint32_t index_count = 0) = 0; @@ -46,23 +47,33 @@ namespace Donut class RenderCommand { public: - inline static void init() { + inline static void init() + { s_renderer_api->init(); } - inline static void set_viewport(uint32_t x, uint32_t y, uint32_t width, uint32_t height) { + inline static void set_viewport(uint32_t x, uint32_t y, uint32_t width, uint32_t height) + { s_renderer_api->set_viewport(x, y, width, height); } - inline static void set_clear_color(const glm::vec4& color) { + inline static void set_clear_color(const glm::vec4& color) + { s_renderer_api->set_clear_color(color); } - inline static void clear() { + inline static void clear() + { s_renderer_api->clear(); } - inline static void draw_indexed(const std::shared_ptr<VertexArray>& vertex_array, uint32_t index_count = 0) { + inline static void enable_depth_test() + { + s_renderer_api->enable_depth_test(); + } + + inline static void draw_indexed(const std::shared_ptr<VertexArray>& vertex_array, uint32_t index_count = 0) + { s_renderer_api->draw_indexed(vertex_array, index_count); } @@ -78,23 +89,14 @@ namespace Donut static void on_window_resize(uint32_t width, uint32_t height); - static void begin_scene(); - static void end_scene(); - static void submit(const std::shared_ptr<Shader>& shader, const std::shared_ptr<VertexArray>& vertex_array, - const glm::mat4& transform = glm::mat4(1.0f)); + const glm::mat4& transform, + const glm::mat4& view_projection); static void set_clear_color(const glm::vec4& color); static void clear(); inline static RendererAPI::API get_api() { return RendererAPI::get_api(); } - private: - struct SceneData - { - glm::mat4 ViewProjectionMatrix; - }; - - static SceneData* s_scene_data; }; }; |
