22#ifndef BACKENDS_GRAPHICS_OPENGL_FRAMEBUFFER_H
23#define BACKENDS_GRAPHICS_OPENGL_FRAMEBUFFER_H
25#include "graphics/opengl/system_headers.h"
27#include "math/matrix4.h"
29#include "common/rotationmode.h"
110 kCopyMaskClearColor = (1 << 0),
111 kCopyMaskBlendState = (1 << 1),
112 kCopyMaskScissorState = (1 << 2),
113 kCopyMaskScissorBox = (1 << 4),
115 kCopyMaskAll = kCopyMaskClearColor | kCopyMaskBlendState |
116 kCopyMaskScissorState | kCopyMaskScissorBox,
125 bool isActive()
const {
return _pipeline !=
nullptr; }
128 void applyViewport();
130 Math::Matrix4 _projectionMatrix;
131 void applyProjectionMatrix();
152 virtual bool setSize(uint width, uint height) = 0;
167 GLfloat _clearColor[4];
168 void applyClearColor();
171 void applyBlendState();
173 bool _scissorTestState;
174 void applyScissorTestState();
176 GLint _scissorBox[4];
177 void applyScissorBox();
188 bool setSize(uint width, uint height)
override;
221 bool setSize(uint width, uint height)
override;
Definition: framebuffer.h:183
bool setSize(uint width, uint height) override
void activateInternal() override
Definition: framebuffer.h:38
void activate(Pipeline *pipeline)
virtual void activateInternal()=0
virtual bool setSize(uint width, uint height)=0
void setClearColor(GLfloat r, GLfloat g, GLfloat b, GLfloat a)
void setScissorBox(GLint x, GLint y, GLsizei w, GLsizei h)
void enableBlend(BlendMode mode)
void copyRenderStateFrom(const Framebuffer &other, uint copyMask)
BlendMode
Definition: framebuffer.h:44
@ kBlendModeOpaque
Definition: framebuffer.h:55
@ kBlendModeDisabled
Definition: framebuffer.h:49
@ kBlendModePremultipliedTransparency
Definition: framebuffer.h:70
@ kBlendModeAdditive
Definition: framebuffer.h:75
@ kBlendModeTraditionalTransparency
Definition: framebuffer.h:61
@ kBlendModeMaskAlphaAndInvertByColor
Definition: framebuffer.h:81
virtual void deactivateInternal()
Definition: framebuffer.h:146
const Math::Matrix4 & getProjectionMatrix() const
Definition: framebuffer.h:107
void enableScissorTest(bool enable)
Definition: pipeline.h:40
Definition: framebuffer.h:203
bool setSize(uint width, uint height) override
Texture * getTexture() const
Definition: framebuffer.h:226
void activateInternal() override