Object handle for OpenGL Frame Buffer Objects. More...
#include <HdlFBO.hpp>
Public Member Functions | |
HdlFBO (const HdlAbstractTextureFormat &f, int numTarget=1) | |
HdlFBO Construtor. More... | |
int | addTarget (void) |
Add a new texture to target list. | |
int | getNumTargets (void) const |
Get the number of targets. More... | |
int | getAttachmentCount (void) const |
Return the number of attachment points. More... | |
void | addDepthBuffer (void) |
Add a depth buffer to this Framebuffer object. | |
bool | hasDepthBuffer (void) |
Test if a depth buffer is currently attached to this object. More... | |
void | removeDepthBuffer (void) |
Remove the depth buffer currently attached to this frame buffer. | |
void | beginRendering (int usedTarget=0, bool useExistingDepthBuffer=false) |
Prepare the FBO for rendering in it. More... | |
void | endRendering (void) |
End the rendering in the FBO, build the mipmaps for the target. | |
void | bind (void) |
Bind this FBO. | |
HdlTexture * | operator[] (int i) |
Get a target of the FBO. More... | |
size_t | getSize (bool askDriver=false) |
Gets the size of the FBO in bytes. More... | |
GLenum | test (void) |
Test the validity of a FBO object. More... | |
Public Member Functions inherited from Glip::CoreGL::HdlAbstractTextureFormat | |
int | getWidth (void) const |
int | getHeight (void) const |
int | getNumPixels (void) const |
int | getNumChannels (void) const |
int | getNumElements (void) const |
int | getAlignment (void) const |
int | getPixelSize (void) const |
virtual size_t | getRowSize (void) const |
virtual size_t | getSize (void) const |
int | getChannelDepth (void) const |
GLenum | getGLMode (void) const |
GLenum | getGLDepth (void) const |
GLenum | getMinFilter (void) const |
GLenum | getMagFilter (void) const |
int | getBaseLevel (void) const |
int | getMaxLevel (void) const |
GLenum | getSWrapping (void) const |
GLenum | getTWrapping (void) const |
bool | isCompressed (void) const |
bool | isFloatingPoint (void) const |
const HdlTextureFormatDescriptor & | getFormatDescriptor (void) const |
bool | operator== (const HdlAbstractTextureFormat &) const |
bool | operator!= (const HdlAbstractTextureFormat &) const |
bool | isCompatibleWith (const HdlAbstractTextureFormat &) const |
Check if the two formats share the same memory characteristics (sizes, number of channels, byte per pixel, internal GL mode, same mipmap levels). More... | |
HdlAbstractTextureFormat | getCompressedFormat (void) const |
Get the equivalent, but compressed, format. More... | |
HdlAbstractTextureFormat | getUncompressedFormat (void) const |
Get the equivalent, but uncompressed, format. More... | |
bool | isCorrespondingCompressedFormat (const HdlAbstractTextureFormat &) const |
Check if this and f share the same memory parameters except that the mode for f is the corresponding compressed mode of this. More... | |
virtual unsigned int | getSetting (GLenum param) const |
Obtain a setting value based on its GL name. More... | |
Static Public Member Functions | |
static int | getMaximumColorAttachment (void) |
Get the maximum number of attachment points. More... | |
static GLenum | getAttachment (int i) |
Convert an attachment ID to the corresponding OpenGL constant. More... | |
static int | getIndexFromAttachment (GLenum attachment) |
Convert an OpenGL constant to the corresponding attachment ID. More... | |
static void | unbind (void) |
Unbind the FBO which is currently bound to the OpenGL context. | |
Static Public Member Functions inherited from Glip::CoreGL::HdlAbstractTextureFormat | |
static int | getMaxSize (void) |
Returns the maximum size for a texture. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from Glip::CoreGL::HdlAbstractTextureFormat | |
HdlAbstractTextureFormat (int _width, int _height, GLenum _mode, GLenum _depth, GLenum _minFilter=GL_NEAREST, GLenum _magFilter=GL_NEAREST, GLenum _wraps=GL_CLAMP, GLenum _wrapt=GL_CLAMP, int _baseLevel=0, int _maxLevel=0) | |
HdlAbstractTextureFormat Construtor. More... | |
HdlAbstractTextureFormat (const HdlAbstractTextureFormat ©) | |
HdlAbstractTextureFormat Construtor. More... | |
void | setAlignment (int _alignment) |
Set the alignment for this format. More... | |
Object handle for OpenGL Frame Buffer Objects.
This class can manage a Frame Buffer Object and multiple rendering target, each one of these rendering target have the same format.
HdlFBO::HdlFBO | ( | const HdlAbstractTextureFormat & | f, |
int | numTarget = 1 |
||
) |
HdlFBO Construtor.
f | Format of the textures attached to the rendering point. |
numTarget | Number of targets to be built by the constructor. |
void HdlFBO::beginRendering | ( | int | usedTarget = 0 , |
bool | useExistingDepthBuffer = false |
||
) |
Prepare the FBO for rendering in it.
usedTarget | The number of targets to be used. It must be greater or equal to 1 and less or equal to getAttachmentCount(). Default is 0 which means all targets. |
usedTarget | Number of targets used in this FBO. |
useExistingDepthBuffer | If true and if a depth buffer is currently attached, it will be used (see HdlFBO::addDepthBuffer). |
|
static |
Convert an attachment ID to the corresponding OpenGL constant.
i | The ID of the attachment point. |
int HdlFBO::getAttachmentCount | ( | void | ) | const |
Return the number of attachment points.
|
static |
Convert an OpenGL constant to the corresponding attachment ID.
attachment | The OpenGL constant representing the attachment point. |
|
static |
Get the maximum number of attachment points.
int HdlFBO::getNumTargets | ( | void | ) | const |
Get the number of targets.
size_t HdlFBO::getSize | ( | bool | askDriver = false | ) |
Gets the size of the FBO in bytes.
askDriver | If true, it will use HdlTexture::getSizeOnGPU() to determine the real size (might be slower). |
bool HdlFBO::hasDepthBuffer | ( | void | ) |
Test if a depth buffer is currently attached to this object.
HdlTexture * HdlFBO::operator[] | ( | int | i | ) |
Get a target of the FBO.
i | Index of the target. |
GLenum HdlFBO::test | ( | void | ) |
Test the validity of a FBO object.