sgltk 0.6
Simple OpenGL Tool Kit
|
Manages framebuffers. More...
#include <framebuffer.h>
Public Member Functions | |
Framebuffer (GLenum target=GL_FRAMEBUFFER) | |
GLenum | get_buffer_status () |
Checks the completeness status of the framebuffer. | |
void | bind () |
Binds the framebuffer to the target set in the constructor. | |
void | bind (GLenum target) |
Binds the framebuffer to a framebuffer target. | |
void | unbind () |
Restores the original framebuffer as render target. | |
bool | attach_texture (GLenum attachment, Texture &texture) |
Attaches a texture to the framebuffer. | |
bool | attach_texture_layer (GLenum attachment, Texture &texture, unsigned int layer) |
Attaches the layer of a texture to the framebuffer. | |
bool | attach_renderbuffer (GLenum attachment, Renderbuffer &buffer) |
Attaches a renderbuffer to the framebuffer. | |
void | finalize () |
Sets the draw buffers to be drawn into. | |
void | blit_to (sgltk::Framebuffer *target, unsigned int src_x0, unsigned int src_y0, unsigned int src_x1, unsigned int src_y1, unsigned int dst_x0, unsigned int dst_y0, unsigned int dst_x1, unsigned int dst_y1, GLbitfield mask, GLenum filter) |
Copies a block of pixels from this framebuffer to another one. | |
void | blit_from_default (unsigned int src_x0, unsigned int src_y0, unsigned int src_x1, unsigned int src_y1, unsigned int dst_x0, unsigned int dst_y0, unsigned int dst_x1, unsigned int dst_y1, GLbitfield mask, GLenum filter) |
Copies a block of pixels from the default framebuffer to this one. |
Manages framebuffers.
Definition at line 14 of file framebuffer.h.
Framebuffer::Framebuffer | ( | GLenum | target = GL_FRAMEBUFFER | ) |
target | The target of the future binding operations |
Definition at line 7 of file framebuffer.cpp.
Framebuffer::~Framebuffer | ( | ) |
Definition at line 17 of file framebuffer.cpp.
bool Framebuffer::attach_renderbuffer | ( | GLenum | attachment, |
Renderbuffer & | buffer ) |
Attaches a renderbuffer to the framebuffer.
attachment | The attachment point to which the renderbuffer is attached |
buffer | The renderbuffer to attach |
Definition at line 121 of file framebuffer.cpp.
bool Framebuffer::attach_texture | ( | GLenum | attachment, |
Texture & | texture ) |
Attaches a texture to the framebuffer.
attachment | The attachment point to which the texture is attached |
texture | The texture to attach |
Definition at line 45 of file framebuffer.cpp.
bool Framebuffer::attach_texture_layer | ( | GLenum | attachment, |
Texture & | texture, | ||
unsigned int | layer ) |
Attaches the layer of a texture to the framebuffer.
attachment | The attachment point to which the texture layer is attached |
texture | The texture containing the layer to attach |
layer | The layer to attach |
Definition at line 80 of file framebuffer.cpp.
void Framebuffer::bind | ( | ) |
Binds the framebuffer to the target set in the constructor.
Definition at line 28 of file framebuffer.cpp.
void Framebuffer::bind | ( | GLenum | target | ) |
Binds the framebuffer to a framebuffer target.
target | The target of the binding operation |
Definition at line 32 of file framebuffer.cpp.
void Framebuffer::blit_from_default | ( | unsigned int | src_x0, |
unsigned int | src_y0, | ||
unsigned int | src_x1, | ||
unsigned int | src_y1, | ||
unsigned int | dst_x0, | ||
unsigned int | dst_y0, | ||
unsigned int | dst_x1, | ||
unsigned int | dst_y1, | ||
GLbitfield | mask, | ||
GLenum | filter ) |
Copies a block of pixels from the default framebuffer to this one.
src_x0,src_y0,src_x1,src_y1 | The bounds of the source rectangle within the default framebuffer |
dst_x0,dst_y0,dst_x1,dst_y1 | The bounds of the destination rectangle |
mask | The bitwise OR of the flags indicating which buffers are to be copied. The allowed flags are GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT and GL_STENCIL_BUFFER_BIT. |
filter | The interpolation to be applied if the image is stretched. Must be GL_NEAREST or GL_LINEAR. |
Definition at line 194 of file framebuffer.cpp.
void Framebuffer::blit_to | ( | sgltk::Framebuffer * | target, |
unsigned int | src_x0, | ||
unsigned int | src_y0, | ||
unsigned int | src_x1, | ||
unsigned int | src_y1, | ||
unsigned int | dst_x0, | ||
unsigned int | dst_y0, | ||
unsigned int | dst_x1, | ||
unsigned int | dst_y1, | ||
GLbitfield | mask, | ||
GLenum | filter ) |
Copies a block of pixels from this framebuffer to another one.
target | The framebuffer to copy to. A null pointer indicates the default framebuffer |
src_x0,src_y0,src_x1,src_y1 | The bounds of the source rectangle within the default framebuffer |
dst_x0,dst_y0,dst_x1,dst_y1 | The bounds of the destination rectangle |
mask | The bitwise OR of the flags indicating which buffers are to be copied. The allowed flags are GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT and GL_STENCIL_BUFFER_BIT. |
filter | The interpolation to be applied if the image is stretched. Must be GL_NEAREST or GL_LINEAR. |
Definition at line 169 of file framebuffer.cpp.
void Framebuffer::finalize | ( | ) |
Sets the draw buffers to be drawn into.
Definition at line 159 of file framebuffer.cpp.
GLenum Framebuffer::get_buffer_status | ( | ) |
Checks the completeness status of the framebuffer.
Definition at line 21 of file framebuffer.cpp.
void Framebuffer::unbind | ( | ) |
Restores the original framebuffer as render target.
Definition at line 41 of file framebuffer.cpp.