summaryrefslogtreecommitdiff
path: root/src/render/gl/GLFramebuffer.hpp
diff options
context:
space:
mode:
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;
+};