#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 tex); void bind(); void unbind(); void release(); void reset(); bool isAllocated(); SP getTexture(); SP getStencilTex(); GLuint getFBID(); Vector2D m_size; private: SP m_tex; GLuint m_fb = -1; bool m_fbAllocated = false; SP m_stencilTex; friend class CRenderbuffer; };