aboutsummaryrefslogtreecommitdiff
path: root/src/rendering/framebuffer.h
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-08-23 17:21:37 +0200
committerhachem <im@hachem.wtf>2026-08-23 17:21:37 +0200
commit3fd33ecff7472e4d6fc9e6b3905f56982e497ef2 (patch)
tree66e5812f1a18b926e88a0dd549fe14e7c7327165 /src/rendering/framebuffer.h
parente3aa33fc9a99d8b817bda42a567a4c347e18ab32 (diff)
[feat]: complete RHI api
Diffstat (limited to 'src/rendering/framebuffer.h')
-rw-r--r--src/rendering/framebuffer.h80
1 files changed, 0 insertions, 80 deletions
diff --git a/src/rendering/framebuffer.h b/src/rendering/framebuffer.h
deleted file mode 100644
index cf1fbef..0000000
--- a/src/rendering/framebuffer.h
+++ /dev/null
@@ -1,80 +0,0 @@
-#pragma once
-
-#include "core/memory.h"
-#include "texture.h"
-
-#include <vector>
-
-namespace Donut
-{
- enum class FramebufferTextureFormat
- {
- None = 0,
-
- RGBA8,
- RED_INTEGER,
-
- DEPTH24STENCIL8,
-
- Depth = DEPTH24STENCIL8
- };
-
- struct FramebufferTextureSpecification
- {
- FramebufferTextureSpecification() = default;
- FramebufferTextureSpecification(FramebufferTextureFormat format)
- : texture_format(format) {}
-
- FramebufferTextureFormat texture_format = FramebufferTextureFormat::None;
- };
-
- struct FramebufferAttachmentSpecification
- {
- FramebufferAttachmentSpecification() = default;
- FramebufferAttachmentSpecification(std::initializer_list<FramebufferTextureSpecification> attachments)
- : attachments(attachments) {}
-
- std::vector<FramebufferTextureSpecification> attachments;
- };
-
- struct FramebufferSpecification
- {
- uint32_t Width = 0, Height = 0;
- FramebufferAttachmentSpecification attachments;
- uint32_t Samples = 1;
-
- bool SwapChainTarget = false;
- };
-
- class Framebuffer
- {
- public:
- Framebuffer(const FramebufferSpecification& spec);
- ~Framebuffer();
-
- auto bind() -> void;
- auto unbind() -> void;
-
- auto resize(uint32_t width, uint32_t height) -> void;
- auto read_pixel(uint32_t attachment_index, int x, int y) -> int;
-
- auto clear_attachment(uint32_t attachment_index, int value) -> void;
- auto get_color_attachment_renderer_id(uint32_t index = 0) const -> uint32_t { return m_color_attachments[index]; }
-
- auto get_specification() const -> const FramebufferSpecification& { return m_specification; }
-
- static auto create(const FramebufferSpecification& spec) -> Ref<Framebuffer>;
-
- private:
- auto invalidate() -> void;
-
- uint32_t m_renderer_id = 0;
- FramebufferSpecification m_specification;
-
- std::vector<FramebufferTextureSpecification> m_color_attachment_specifications;
- FramebufferTextureSpecification m_depth_attachment_specification = FramebufferTextureFormat::None;
-
- std::vector<uint32_t> m_color_attachments;
- uint32_t m_depth_attachment = 0;
- };
-};