From 5b361d81dbd2af0d0e99b9eb1adebea76ff05db0 Mon Sep 17 00:00:00 2001 From: hachem Date: Thu, 20 Aug 2026 02:27:02 +0200 Subject: [chore]: MASSIVE refactor + more vulkan bs --- src/platform/opengl/opengl_framebuffer.h | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/platform/opengl/opengl_framebuffer.h (limited to 'src/platform/opengl/opengl_framebuffer.h') diff --git a/src/platform/opengl/opengl_framebuffer.h b/src/platform/opengl/opengl_framebuffer.h new file mode 100644 index 0000000..456d924 --- /dev/null +++ b/src/platform/opengl/opengl_framebuffer.h @@ -0,0 +1,35 @@ +#pragma once + +#include "rendering/framebuffer.h" + +namespace Donut +{ + class OpenGLFramebuffer : public Framebuffer + { + public: + OpenGLFramebuffer(const FramebufferSpecification& spec); + virtual ~OpenGLFramebuffer(); + + auto invalidate() -> void; + + virtual auto bind() -> void override; + virtual auto unbind() -> void override; + + virtual auto resize(uint32_t width, uint32_t height) -> void override; + virtual auto read_pixel(uint32_t attachment_index, int x, int y) -> int override; + + virtual auto clear_attachment(uint32_t attachment_index, int value) -> void override; + virtual auto get_color_attachment_renderer_id(uint32_t index = 0) const -> uint32_t override{ return m_color_attachments[index]; } + + virtual auto get_specification() const -> const FramebufferSpecification& override{ return m_specification; } + private: + uint32_t m_renderer_id = 0; + FramebufferSpecification m_specification; + + std::vector m_color_attachment_specifications; + FramebufferTextureSpecification m_depth_attachment_specification = FramebufferTextureFormat::None; + + std::vector m_color_attachments; + uint32_t m_depth_attachment = 0; + }; +}; -- cgit v1.3