diff options
| author | hachem <im@hachem.wtf> | 2025-08-22 00:22:12 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2025-08-22 00:22:12 +0200 |
| commit | 01fadbecbed89afffb18b2cf5cf3972845a7a169 (patch) | |
| tree | 1faf64e41f4a9b59e8ad6f68363c590dfc089cc4 /src/Platform/OpenGL/OpenGLFramebuffer.h | |
| parent | 6f72049359651155be62846e7d080d7a5e871096 (diff) | |
[add]: frame exporting
Diffstat (limited to 'src/Platform/OpenGL/OpenGLFramebuffer.h')
| -rw-r--r-- | src/Platform/OpenGL/OpenGLFramebuffer.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/Platform/OpenGL/OpenGLFramebuffer.h b/src/Platform/OpenGL/OpenGLFramebuffer.h new file mode 100644 index 0000000..8cd376c --- /dev/null +++ b/src/Platform/OpenGL/OpenGLFramebuffer.h @@ -0,0 +1,35 @@ +#pragma once + +#include "Rendering/Framebuffer.h" + +namespace Donut +{ + class OpenGLFramebuffer : public Framebuffer + { + public: + OpenGLFramebuffer(const FramebufferSpecification& spec); + virtual ~OpenGLFramebuffer(); + + void Invalidate(); + + virtual void Bind() override; + virtual void Unbind() override; + + virtual void Resize(uint32_t width, uint32_t height) override; + virtual int ReadPixel(uint32_t attachmentIndex, int x, int y) override; + + virtual void ClearAttachment(uint32_t attachmentIndex, int value) override; + virtual uint32_t GetColorAttachmentRendererID(uint32_t index = 0) const override { return m_ColorAttachments[index]; } + + virtual const FramebufferSpecification& GetSpecification() const override { return m_Specification; } + private: + uint32_t m_RendererID = 0; + FramebufferSpecification m_Specification; + + std::vector<FramebufferTextureSpecification> m_ColorAttachmentSpecifications; + FramebufferTextureSpecification m_DepthAttachmentSpecification = FramebufferTextureFormat::None; + + std::vector<uint32_t> m_ColorAttachments; + uint32_t m_DepthAttachment = 0; + }; +}; |
