Equalizer 1.0
|
A C++ class to abstract OpenGL frame buffer objects. More...
#include <frameBufferObject.h>
Public Member Functions | |
FrameBufferObject (const GLEWContext *const glewContext, const GLenum textureTarget=GL_TEXTURE_RECTANGLE_ARB) | |
Construct a new Frame Buffer Object. | |
~FrameBufferObject () | |
Destruct the Frame Buffer Object. | |
bool | addColorTexture () |
Add one color texture to the FBO. | |
bool | init (const int32_t width, const int32_t height, const GLuint colorFormat, const int32_t depthSize, const int32_t stencilSize) |
Initialize the Frame Buffer Object. | |
void | exit () |
De-initialize the Frame Buffer Object. | |
void | bind () |
Bind to the Frame Buffer Object. | |
void | unbind () |
Unbind any Frame Buffer Object and use the default drawable for the current context. | |
bool | resize (const int32_t width, const int32_t height) |
Resize the FBO. | |
int32_t | getWidth () const |
int32_t | getHeight () const |
const Textures & | getColorTextures () const |
const Texture & | getDepthTexture () const |
const co::base::Error & | getError () |
const GLEWContext * | glewGetContext () const |
bool | isValid () const |
A C++ class to abstract OpenGL frame buffer objects.
Definition at line 35 of file frameBufferObject.h.
eq::util::FrameBufferObject::FrameBufferObject | ( | const GLEWContext *const | glewContext, |
const GLenum | textureTarget = GL_TEXTURE_RECTANGLE_ARB |
||
) |
Construct a new Frame Buffer Object.
eq::util::FrameBufferObject::~FrameBufferObject | ( | ) |
Destruct the Frame Buffer Object.
bool eq::util::FrameBufferObject::addColorTexture | ( | ) |
Add one color texture to the FBO.
The first color texture is automatically created in the constructor. The maximum number of textures per FBO is 16. Added color textures will have the same format as the existing texture(s). This method has to be called on an uninitialized FBO.
void eq::util::FrameBufferObject::bind | ( | ) |
Bind to the Frame Buffer Object.
The FBO becomes the read and draw buffer of the current context.
void eq::util::FrameBufferObject::exit | ( | ) |
const Textures& eq::util::FrameBufferObject::getColorTextures | ( | ) | const [inline] |
Definition at line 118 of file frameBufferObject.h.
const Texture& eq::util::FrameBufferObject::getDepthTexture | ( | ) | const [inline] |
const co::base::Error& eq::util::FrameBufferObject::getError | ( | ) | [inline] |
Definition at line 124 of file frameBufferObject.h.
int32_t eq::util::FrameBufferObject::getHeight | ( | ) | const [inline] |
int32_t eq::util::FrameBufferObject::getWidth | ( | ) | const [inline] |
const GLEWContext* eq::util::FrameBufferObject::glewGetContext | ( | ) | const [inline] |
bool eq::util::FrameBufferObject::init | ( | const int32_t | width, |
const int32_t | height, | ||
const GLuint | colorFormat, | ||
const int32_t | depthSize, | ||
const int32_t | stencilSize | ||
) |
Initialize the Frame Buffer Object.
On successful initialization, the FBO is bound.
width | the initial width of the rendering buffer. |
height | the initial height of the rendering buffer. |
colorFormat | The internal color texture format, e.g., GL_RGBA. |
depthSize | The bit depth of the depth attachment. |
stencilSize | The bit depth of the stencil attachment. |
bool eq::util::FrameBufferObject::isValid | ( | ) | const [inline] |
bool eq::util::FrameBufferObject::resize | ( | const int32_t | width, |
const int32_t | height | ||
) |
Resize the FBO.
The FBO has to be initialized and bound. It is not changed if the size does not change.
void eq::util::FrameBufferObject::unbind | ( | ) |
Unbind any Frame Buffer Object and use the default drawable for the current context.