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 29f66a5..d08d015 100644 --- a/src/Rendering/Renderer.h +++ b/src/Rendering/Renderer.h @@ -33,6 +33,7 @@ namespace Donut virtual void SetViewport(uint32_t x, uint32_t y, uint32_t width, uint32_t height) = 0; virtual void SetClearColor(const glm::vec4& color) = 0; virtual void Clear() = 0; + virtual void EnableDepthTest() = 0; virtual void DrawIndexed(const std::shared_ptr<VertexArray>& vertexArray, uint32_t indexCount = 0) = 0; @@ -46,23 +47,33 @@ namespace Donut class RenderCommand { public: - inline static void Init() { + inline static void Init() + { s_RendererAPI->Init(); } - inline static void SetViewport(uint32_t x, uint32_t y, uint32_t width, uint32_t height) { + inline static void SetViewport(uint32_t x, uint32_t y, uint32_t width, uint32_t height) + { s_RendererAPI->SetViewport(x, y, width, height); } - inline static void SetClearColor(const glm::vec4& color) { + inline static void SetClearColor(const glm::vec4& color) + { s_RendererAPI->SetClearColor(color); } - inline static void Clear() { + inline static void Clear() + { s_RendererAPI->Clear(); } - inline static void DrawIndexed(const std::shared_ptr<VertexArray>& vertexArray, uint32_t indexCount = 0) { + inline static void EnableDepthTest() + { + s_RendererAPI->EnableDepthTest(); + } + + inline static void DrawIndexed(const std::shared_ptr<VertexArray>& vertexArray, uint32_t indexCount = 0) + { s_RendererAPI->DrawIndexed(vertexArray, indexCount); } @@ -78,23 +89,14 @@ namespace Donut static void OnWindowResize(uint32_t width, uint32_t height); - static void BeginScene(); - static void EndScene(); - static void Submit(const std::shared_ptr<Shader>& shader, const std::shared_ptr<VertexArray>& vertexArray, - const glm::mat4& transform = glm::mat4(1.0f)); + const glm::mat4& transform, + const glm::mat4& viewProjection); static void SetClearColor(const glm::vec4& color); static void Clear(); inline static RendererAPI::API GetAPI() { return RendererAPI::GetAPI(); } - private: - struct SceneData - { - glm::mat4 ViewProjectionMatrix; - }; - - static SceneData* s_SceneData; }; }; |
