eq::util::FrameBufferObject Class Reference

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

#include <frameBufferObject.h>

Inheritance diagram for eq::util::FrameBufferObject:
Inheritance graph
[legend]
Collaboration diagram for eq::util::FrameBufferObject:
Collaboration graph
[legend]

List of all members.

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 TextureVectorgetColorTextures () const
const TexturegetDepthTexture () const
const TexturegetStencilTexture () const
const std::string & getErrorMessage ()
PixelViewport getPixelViewport () const
GLEWContext * glewGetContext ()
const GLEWContext * glewGetContext () const

Detailed Description

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

Definition at line 34 of file frameBufferObject.h.


Member Function Documentation

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().

Parameters:
format new format of color texture

Definition at line 58 of file frameBufferObject.cpp.

Referenced by eq::GLWindow::configInitFBO(), and eq::util::AccumBufferObject::init().

Here is the caller graph for this function:

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.

Returns:
false if color texture can't be added, otherwise true

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.

Parameters:
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.
Returns:
true on success, false otherwise
See also:
resize(), getErrorMessage()

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

void eq::util::FrameBufferObject::bind (  ) 

Bind to the Frame Buffer Object as the read and draw buffer of the current context.

See also:
getErrorMessage()

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().

Here is the caller graph for this function:

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.

Returns:
true on success, false on error.
See also:
getErrorMessage()

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().

Here is the call graph for this function:

Here is the caller graph for this function:

const TextureVector& eq::util::FrameBufferObject::getColorTextures (  )  const [inline]
Returns:
the color textures.

Definition at line 105 of file frameBufferObject.h.

Referenced by eq::util::AccumBufferObject::display().

Here is the caller graph for this function:

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

Definition at line 108 of file frameBufferObject.h.

const Texture& eq::util::FrameBufferObject::getStencilTexture (  )  const [inline]
Returns:
the stencil texture.

Definition at line 111 of file frameBufferObject.h.

const std::string& eq::util::FrameBufferObject::getErrorMessage (  )  [inline]
Returns:
the reason for the last failed operation.

Definition at line 114 of file frameBufferObject.h.

Referenced by eq::GLWindow::configInitFBO().

Here is the caller graph for this function:

PixelViewport eq::util::FrameBufferObject::getPixelViewport (  )  const
Returns:
the size of this framebuffer object.

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().

Here is the caller graph for this function:


The documentation for this class was generated from the following files:
Generated on Sat Feb 6 13:15:03 2010 for Equalizer 0.9.1 by  doxygen 1.6.1