Equalizer 1.0

eq::util::FrameBufferObject Class Reference

A C++ class to abstract OpenGL frame buffer objects. More...

#include <frameBufferObject.h>

Inheritance diagram for eq::util::FrameBufferObject:
Collaboration diagram for eq::util::FrameBufferObject:

List of all members.

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 TexturesgetColorTextures () const
const TexturegetDepthTexture () const
const co::base::ErrorgetError ()
const GLEWContext * glewGetContext () const
bool isValid () const

Detailed Description

A C++ class to abstract OpenGL frame buffer objects.

Definition at line 35 of file frameBufferObject.h.


Constructor & Destructor Documentation

eq::util::FrameBufferObject::FrameBufferObject ( const GLEWContext *const  glewContext,
const GLenum  textureTarget = GL_TEXTURE_RECTANGLE_ARB 
)

Construct a new Frame Buffer Object.

Version:
1.0
eq::util::FrameBufferObject::~FrameBufferObject ( )

Destruct the Frame Buffer Object.

Version:
1.0

Member Function Documentation

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.

Returns:
false if color texture can't be added, otherwise true.
Version:
1.0
void eq::util::FrameBufferObject::bind ( )

Bind to the Frame Buffer Object.

The FBO becomes the read and draw buffer of the current context.

See also:
getError()
Version:
1.0
void eq::util::FrameBufferObject::exit ( )

De-initialize the Frame Buffer Object.

Version:
1.0

Reimplemented in eq::util::AccumBufferObject.

const Textures& eq::util::FrameBufferObject::getColorTextures ( ) const [inline]
Returns:
the vector of color textures.
Version:
1.0

Definition at line 118 of file frameBufferObject.h.

const Texture& eq::util::FrameBufferObject::getDepthTexture ( ) const [inline]
Returns:
the depth texture.
Version:
1.0

Definition at line 121 of file frameBufferObject.h.

const co::base::Error& eq::util::FrameBufferObject::getError ( ) [inline]
Returns:
the reason for the last failed operation.
Version:
1.0

Definition at line 124 of file frameBufferObject.h.

int32_t eq::util::FrameBufferObject::getHeight ( ) const [inline]
Returns:
the current height.
Version:
1.0

Definition at line 114 of file frameBufferObject.h.

int32_t eq::util::FrameBufferObject::getWidth ( ) const [inline]
Returns:
the current width.
Version:
1.0

Definition at line 110 of file frameBufferObject.h.

const GLEWContext* eq::util::FrameBufferObject::glewGetContext ( ) const [inline]
Returns:
the GLEW context.
Version:
1.0

Definition at line 127 of file frameBufferObject.h.

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.

Parameters:
widththe initial width of the rendering buffer.
heightthe initial height of the rendering buffer.
colorFormatThe internal color texture format, e.g., GL_RGBA.
depthSizeThe bit depth of the depth attachment.
stencilSizeThe bit depth of the stencil attachment.
Returns:
true on success, false otherwise
See also:
resize(), getError()
Version:
1.0
bool eq::util::FrameBufferObject::isValid ( ) const [inline]
Returns:
true if the fbo is valid.
Version:
1.0

Definition at line 130 of file frameBufferObject.h.

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.

Returns:
true on success, false on error.
See also:
getError()
Version:
1.0
void eq::util::FrameBufferObject::unbind ( )

Unbind any Frame Buffer Object and use the default drawable for the current context.

Version:
1.0

The documentation for this class was generated from the following file:
Generated on Sun May 8 2011 19:11:10 for Equalizer 1.0 by  doxygen 1.7.3