Hyprland/src/render/Framebuffer.hpp

33 lines
687 B
C++
Raw Normal View History

2022-04-05 20:49:15 +02:00
#pragma once
#include "../defines.hpp"
#include "Texture.hpp"
class CFramebuffer {
public:
CFramebuffer();
~CFramebuffer();
bool alloc(int w, int h, uint32_t format = GL_RGBA);
void addStencil(SP<CTexture> tex);
void bind();
void unbind();
void release();
void reset();
bool isAllocated();
SP<CTexture> getTexture();
SP<CTexture> getStencilTex();
GLuint getFBID();
2022-04-05 20:49:15 +02:00
Vector2D m_size;
2022-04-05 20:49:15 +02:00
private:
SP<CTexture> m_tex;
GLuint m_fb = -1;
bool m_fbAllocated = false;
2022-04-05 20:49:15 +02:00
SP<CTexture> m_stencilTex;
friend class CRenderbuffer;
};