summaryrefslogtreecommitdiff
path: root/src/render/gl/GLFramebuffer.hpp
diff options
context:
space:
mode:
authorUjinT34 <41110182+UjinT34@users.noreply.github.com>2026-03-07 00:44:10 +0300
committerGitHub <noreply@github.com>2026-03-06 21:44:10 +0000
commit4152ac76d0813d9d0f67d2f04653a13fa6e17433 (patch)
treec341f1883cf5a182d32e4ad00192ba8786a9bb75 /src/render/gl/GLFramebuffer.hpp
parenta5858018d896e0e0f0db517f893cd9a0936dd881 (diff)
renderer: refactor Texture, Framebuffer and Renderbuffer (#13437)
Part 1 of the renderer refactors
Diffstat (limited to 'src/render/gl/GLFramebuffer.hpp')
-rw-r--r--src/render/gl/GLFramebuffer.hpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/render/gl/GLFramebuffer.hpp b/src/render/gl/GLFramebuffer.hpp
new file mode 100644
index 00000000..c171444e
--- /dev/null
+++ b/src/render/gl/GLFramebuffer.hpp
@@ -0,0 +1,30 @@
+#pragma once
+
+#include "../../defines.hpp"
+#include "../Texture.hpp"
+#include "../Framebuffer.hpp"
+#include <drm_fourcc.h>
+
+class CGLFramebuffer : public IFramebuffer {
+ public:
+ CGLFramebuffer();
+ CGLFramebuffer(const std::string& name);
+ ~CGLFramebuffer();
+
+ void addStencil(SP<ITexture> tex) override;
+ void release() override;
+ bool readPixels(CHLBufferReference buffer, uint32_t offsetX = 0, uint32_t offsetY = 0, uint32_t width = 0, uint32_t height = 0) override;
+
+ void bind() override;
+ void unbind();
+ GLuint getFBID();
+ void invalidate(const std::vector<GLenum>& attachments);
+
+ protected:
+ bool internalAlloc(int w, int h, uint32_t format = DRM_FORMAT_ARGB8888) override;
+
+ private:
+ GLuint m_fb = -1;
+
+ friend class CGLRenderbuffer;
+};