#include <framebuffer.h>
Public Types | |
enum | BlendMode { kBlendModeDisabled, kBlendModeOpaque, kBlendModeTraditionalTransparency, kBlendModePremultipliedTransparency, kBlendModeAdditive, kBlendModeMaskAlphaAndInvertByColor } |
enum | CopyMask { kCopyMaskClearColor = (1 << 0), kCopyMaskBlendState = (1 << 1), kCopyMaskScissorState = (1 << 2), kCopyMaskScissorBox = (1 << 4), kCopyMaskAll } |
Public Member Functions | |
void | setClearColor (GLfloat r, GLfloat g, GLfloat b, GLfloat a) |
void | enableBlend (BlendMode mode) |
void | enableScissorTest (bool enable) |
void | setScissorBox (GLint x, GLint y, GLsizei w, GLsizei h) |
const Math::Matrix4 & | getProjectionMatrix () const |
void | copyRenderStateFrom (const Framebuffer &other, uint copyMask) |
virtual bool | setSize (uint width, uint height, Common::RotationMode rotation)=0 |
void | activate (Pipeline *pipeline) |
void | deactivate () |
Protected Member Functions | |
bool | isActive () const |
void | applyViewport () |
void | applyProjectionMatrix () |
virtual void | activateInternal ()=0 |
virtual void | deactivateInternal () |
Protected Attributes | |
GLint | _viewport [4] |
Math::Matrix4 | _projectionMatrix |
Object describing a framebuffer OpenGL can render to.
void OpenGL::Framebuffer::setClearColor | ( | GLfloat | r, |
GLfloat | g, | ||
GLfloat | b, | ||
GLfloat | a | ||
) |
Set the clear color of the framebuffer.
void OpenGL::Framebuffer::enableBlend | ( | BlendMode | mode | ) |
Enable/disable GL_BLEND.
void OpenGL::Framebuffer::enableScissorTest | ( | bool | enable | ) |
Enable/disable GL_SCISSOR_TEST.
void OpenGL::Framebuffer::setScissorBox | ( | GLint | x, |
GLint | y, | ||
GLsizei | w, | ||
GLsizei | h | ||
) |
Set scissor box dimensions.
|
inline |
Obtain projection matrix of the framebuffer.
void OpenGL::Framebuffer::copyRenderStateFrom | ( | const Framebuffer & | other, |
uint | copyMask | ||
) |
Copy rendering state from another framebuffer
|
protectedpure virtual |
Activate framebuffer.
This is supposed to set all state associated with the framebuffer.
Implemented in OpenGL::TextureTarget, OpenGL::Backbuffer, LibretroHWFramebuffer, and OpenGL::RenderbufferTarget.
|
inlineprotectedvirtual |
Deactivate framebuffer.
This is supposed to make any cleanup required when unbinding the framebuffer.
|
pure virtual |
Set the size of the target buffer.
Implemented in OpenGL::TextureTarget, OpenGL::Backbuffer, and OpenGL::RenderbufferTarget.
void OpenGL::Framebuffer::activate | ( | Pipeline * | pipeline | ) |
Accessor to activate framebuffer for pipeline.
void OpenGL::Framebuffer::deactivate | ( | ) |
Accessor to deactivate framebuffer from pipeline.