A C++ class to abstract OpenGL frame buffer objects. More...
#include <frameBufferObject.h>


Public Member Functions | |
| FrameBufferObject (GLEWContext *const glewContext) | |
| Construct a new Frame Buffer Object. | |
| ~FrameBufferObject () | |
| Destruct the Frame Buffer Object. | |
| void | setColorFormat (const GLuint format) |
| Set format for all color textures, if desired format differs from the default format GL_RGBA. | |
| bool | addColorTexture () |
| Add one color texture to the FBO. | |
| bool | init (const int width, const int height, const int depthSize, const int stencilSize) |
| Initialize the Frame Buffer Object. | |
| void | exit () |
| De-initialize the Frame Buffer Object. | |
| void | bind () |
| Bind to the Frame Buffer Object as the read and draw buffer of the current context. | |
| void | unbind () |
| Unbind any Frame Buffer Object and use the default drawable for the current context. | |
| bool | resize (const int width, const int height) |
| Resize the FBO. | |
| const TextureVector & | getColorTextures () const |
| const Texture & | getDepthTexture () const |
| const Texture & | getStencilTexture () const |
| const std::string & | getErrorMessage () |
| PixelViewport | getPixelViewport () const |
| GLEWContext * | glewGetContext () |
| const GLEWContext * | glewGetContext () const |
A C++ class to abstract OpenGL frame buffer objects.
Definition at line 34 of file frameBufferObject.h.
| void eq::util::FrameBufferObject::setColorFormat | ( | const GLuint | format | ) |
Set format for all color textures, if desired format differs from the default format GL_RGBA.
This function should be called before init().
| format | new format of color texture |
Definition at line 58 of file frameBufferObject.cpp.
Referenced by eq::GLWindow::configInitFBO(), and eq::util::AccumBufferObject::init().

| bool eq::util::FrameBufferObject::addColorTexture | ( | ) |
Add one color texture to the FBO.
One 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 function has to be called on an uninitialized FBO.
Definition at line 64 of file frameBufferObject.cpp.
References EQERROR.
| bool eq::util::FrameBufferObject::init | ( | const int | width, | |
| const int | height, | |||
| const int | depthSize, | |||
| const int | 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. | |
| depthSize | The bit depth of the depth attachment | |
| stencilSize | The bit depth of the stencil attachment. |
Definition at line 79 of file frameBufferObject.cpp.
References eq::util::Texture::bindToFBO(), EQWARN, and exit().
Referenced by eq::GLWindow::configInitFBO(), and eq::util::AccumBufferObject::init().


| void eq::util::FrameBufferObject::exit | ( | ) |
De-initialize the Frame Buffer Object.
Reimplemented in eq::util::AccumBufferObject.
Definition at line 118 of file frameBufferObject.cpp.
References eq::util::Texture::flush().
Referenced by eq::GLWindow::configExitFBO(), init(), and ~FrameBufferObject().


| void eq::util::FrameBufferObject::bind | ( | ) |
Bind to the Frame Buffer Object as the read and draw buffer of the current context.
Definition at line 177 of file frameBufferObject.cpp.
Referenced by eq::util::AccumBufferObject::accum(), eq::Channel::applyFrameBufferObject(), eq::GLWindow::bindFrameBuffer(), and eq::util::AccumBufferObject::load().

| bool eq::util::FrameBufferObject::resize | ( | const int | width, | |
| const int | height | |||
| ) |
Resize the FBO.
The FBO has to be initialized and bound. It is not changed if the size does not change.
Definition at line 189 of file frameBufferObject.cpp.
References eq::util::Texture::isValid(), and eq::util::Texture::resize().
Referenced by eq::Channel::applyFrameBufferObject(), and eq::util::Accum::resize().


| const TextureVector& eq::util::FrameBufferObject::getColorTextures | ( | ) | const [inline] |
Definition at line 105 of file frameBufferObject.h.
Referenced by eq::util::AccumBufferObject::display().

| const Texture& eq::util::FrameBufferObject::getDepthTexture | ( | ) | const [inline] |
Definition at line 108 of file frameBufferObject.h.
| const Texture& eq::util::FrameBufferObject::getStencilTexture | ( | ) | const [inline] |
Definition at line 111 of file frameBufferObject.h.
| const std::string& eq::util::FrameBufferObject::getErrorMessage | ( | ) | [inline] |
Definition at line 114 of file frameBufferObject.h.
Referenced by eq::GLWindow::configInitFBO().

| PixelViewport eq::util::FrameBufferObject::getPixelViewport | ( | ) | const |
Definition at line 213 of file frameBufferObject.cpp.
Referenced by eq::util::AccumBufferObject::accum(), eq::util::AccumBufferObject::load(), eq::util::Accum::resize(), and eq::Channel::setupAssemblyState().

0.9.1 by
1.6.1