light/modules/renderer/private/gl/framebuffers.hpp

38 lines
688 B
C++
Raw Permalink Normal View History

2025-07-05 13:28:41 +03:30
#pragma once
#include <math/vec2.hpp>
#include <math/vec4.hpp>
#include <renderer/framebuffer.hpp>
2025-07-05 13:28:41 +03:30
2025-07-11 00:05:48 +03:30
namespace lt {
2025-07-05 13:28:41 +03:30
class glFramebuffer: public Framebuffer
{
public:
glFramebuffer(const FramebufferSpecification &specification);
2025-07-05 16:07:51 +03:30
~glFramebuffer() override;
2025-07-05 13:28:41 +03:30
void bind_as_target(const math::vec4 &clearColor) override;
2025-07-05 16:07:51 +03:30
void bind_as_resource() override;
2025-07-05 13:28:41 +03:30
void resize(const math::uvec2 &size) override;
2025-07-05 13:28:41 +03:30
2025-07-06 14:02:50 +03:30
auto get_color_attachment() -> void * override
2025-07-05 13:28:41 +03:30
{
return (void *)m_color_attachment_id;
2025-07-05 13:28:41 +03:30
}
2025-07-05 16:07:51 +03:30
private:
FramebufferSpecification m_specification;
unsigned int m_buffer_id;
unsigned int m_color_attachment_id;
unsigned int m_depth_stencil_attachment_id;
2025-07-05 13:28:41 +03:30
};
2025-07-11 00:05:48 +03:30
} // namespace lt