BACKENDS: OPENGL: Activate framebuffer with a specific pipeline

This commit is contained in:
Le Philousophe 2022-10-31 10:50:14 +01:00
parent 29c25ed566
commit 9b951944bc
4 changed files with 18 additions and 14 deletions

View file

@ -28,11 +28,12 @@
namespace OpenGL {
class Pipeline;
/**
* Object describing a framebuffer OpenGL can render to.
*/
class Framebuffer {
friend class Pipeline;
public:
Framebuffer();
virtual ~Framebuffer() {};
@ -86,7 +87,7 @@ public:
*/
const Math::Matrix4 &getProjectionMatrix() const { return _projectionMatrix; }
protected:
bool isActive() const { return _isActive; }
bool isActive() const { return _pipeline != nullptr; }
GLint _viewport[4];
void applyViewport();
@ -109,11 +110,11 @@ protected:
*/
virtual void deactivateInternal() {}
private:
public:
/**
* Accessor to activate framebuffer for pipeline.
*/
void activate();
void activate(Pipeline *pipeline);
/**
* Accessor to deactivate framebuffer from pipeline.
@ -121,7 +122,7 @@ private:
void deactivate();
private:
bool _isActive;
Pipeline *_pipeline;
GLfloat _clearColor[4];
void applyClearColor();