iso::gl::FrameBufferObject Class Reference

#include <iso_gl_frame_buffer_object.h>

Collaboration diagram for iso::gl::FrameBufferObject:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 FrameBufferObject (const math::Vector2< GLsizei > pSize, ColorType pColorType, DataType pDataType) throw (GLException)
 create frame buffer object for offscreen rendering
 ~FrameBufferObject ()
 destructor
bool created () const
void create () throw (GLException)
bool checkStatus ()
 check frame buffer object status
const math::Vector2< GLsizei > & size () const
 return size
ColorType colorType () const
 return internal color format
DataType dataType () const
 return data type
void bind () throw (GLException)
 switches rendering to frame buffer object
Remarks:
fails if frame buffer object is invalid

void release ()
 switches rendering to default mode
Texturetexture (unsigned int pAttachmentPoint) throw (GLException)
 retrieve texture
void addTexture (unsigned int pAttachmentPoint) throw (GLException)
 add texture
void addTexture (Texture *pTexture, unsigned int pAttachmentPoint) throw (GLException)
 add texture
void removeTexture (unsigned int pAttachmentPoint) throw (GLException)
 remove texture
void addDepthBuffer () throw (GLException)
 add depth render buffer
void addStencilBuffer () throw (GLException)
 add depth render buffer
template<class Type>
data::Buffer< Type > * toBuffer () throw (GLException)
 return content of framebuffer as image buffer
template<typename DataType>
void colorBuffer (DataType *pBuffer, unsigned int pAttachmentPoint) throw (GLException)
template<typename DataType>
void depthBuffer (DataType *pBuffer) throw (GLException)
template<typename DataType>
void stencilBuffer (DataType *pBuffer) throw (GLException)

Static Public Member Functions

static int maxTextureCount ()
 return maximum number of textures
static int maxSize ()
 return maximum size of render buffers

Protected Member Functions

 FrameBufferObject ()
 default constructor
void updateDrawBuffers ()
 update draw buffers based on available textures

Static Protected Member Functions

static void staticInitialize ()
 initialize global frame buffer object settings

Protected Attributes

GLuint mId
 maximum size of fbo
math::Vector2< GLsizei > mSize
 id
ColorType mColorType
 size of offscreen rendering buffer
DataType mDataType
 internal color format
Texture ** mTextures
 data type
GLuint mDepthBuffer
 all attached textures
GLuint mStencilBuffer
 depth buffer
GLuint * mDrawBuffers
 stencil buffer
unsigned int mDrawBufferCount
 draw buffers
bool * mTextureCreationFlags
 number of currently available draw buffers
bool mColorFlag
 flags indicating whether textures have been created by the fbo

Static Protected Attributes

static bool sInitialized
static GLint sMaxTextureCount
 flag whether global frame buffer object settings have been initialized
static GLint sMaxSize
 maximum number of textures per fbo

Detailed Description

make sure that opengl has been initialized before you create your first frame buffer object

Created by Daniel Bisig on 11/26/07.


Constructor & Destructor Documentation

FrameBufferObject::FrameBufferObject ( const math::Vector2< GLsizei >  pSize,
ColorType  pColorType,
DataType  pDataType 
) throw (GLException)

create frame buffer object for offscreen rendering

Parameters:
pSize size of offscreen rendering buffer
pColorType color type
pDataType data type
Remarks:
fails if size exceeds maximum size allowed for render buffers

FrameBufferObject::~FrameBufferObject (  ) 

destructor

FrameBufferObject::FrameBufferObject (  )  [protected]

default constructor


Member Function Documentation

bool iso::gl::FrameBufferObject::created (  )  const [inline]

void iso::gl::FrameBufferObject::create (  )  throw (GLException)

bool FrameBufferObject::checkStatus (  ) 

check frame buffer object status

Returns:
true if everything is fine, false otherwise

const math::Vector2< GLsizei > & FrameBufferObject::size (  )  const

return size

Returns:
size

ColorType FrameBufferObject::colorType (  )  const

return internal color format

Returns:
internal color format

DataType FrameBufferObject::dataType (  )  const

return data type

Returns:
data type

void FrameBufferObject::bind (  )  throw (GLException)

switches rendering to frame buffer object

Remarks:
fails if frame buffer object is invalid

rendering will be performed to all attached textures

void FrameBufferObject::release (  ) 

switches rendering to default mode

Texture * FrameBufferObject::texture ( unsigned int  pAttachmentPoint  )  throw (GLException)

retrieve texture

Parameters:
pAttachmentPoint texture attachment point
Returns:
texture
Remarks:
fails if attachement point is out of bounds
returns NULL if there is no texture attached to supplied attachement point

void FrameBufferObject::addTexture ( unsigned int  pAttachmentPoint  )  throw (GLException)

add texture

Parameters:
pAttachmentPoint attachement point
Remarks:
fails if attachement point is out of bounds
creates new texture and attaches it to fbo

void FrameBufferObject::addTexture ( Texture pTexture,
unsigned int  pAttachmentPoint 
) throw (GLException)

add texture

Parameters:
pTexture to attach
pAttachmentPoint attachement point
Remarks:
fails if texture is of different size or color format than frame buffer of attachement point is out of bounds
attaches supplied texture to fbo

void FrameBufferObject::removeTexture ( unsigned int  pAttachmentPoint  )  throw (GLException)

remove texture

Parameters:
pAttachmentPoint attachement point
Remarks:
fails if attachement point is out of bounds

void FrameBufferObject::addDepthBuffer (  )  throw (GLException)

add depth render buffer

creates depth render buffer and attaches it to fbo

void FrameBufferObject::addStencilBuffer (  )  throw (GLException)

add depth render buffer

creates stencil render buffer and attaches it to fbo

int FrameBufferObject::maxTextureCount (  )  [static]

return maximum number of textures

Returns:
maximum number of textures

int FrameBufferObject::maxSize (  )  [static]

return maximum size of render buffers

Returns:
maximum size of render buffers

template<class Type>
data::Buffer< Type > * iso::gl::FrameBufferObject::toBuffer (  )  throw (GLException)

return content of framebuffer as image buffer

Returns:
content of framebuffer as image buffer

template<typename DataType>
void iso::gl::FrameBufferObject::colorBuffer ( DataType pBuffer,
unsigned int  pAttachmentPoint 
) throw (GLException)

template<typename DataType>
void iso::gl::FrameBufferObject::depthBuffer ( DataType pBuffer  )  throw (GLException)

template<typename DataType>
void iso::gl::FrameBufferObject::stencilBuffer ( DataType pBuffer  )  throw (GLException)

void FrameBufferObject::staticInitialize (  )  [static, protected]

initialize global frame buffer object settings

void FrameBufferObject::updateDrawBuffers (  )  [protected]

update draw buffers based on available textures


Member Data Documentation

bool FrameBufferObject::sInitialized [static, protected]

GLint FrameBufferObject::sMaxTextureCount [static, protected]

flag whether global frame buffer object settings have been initialized

GLint FrameBufferObject::sMaxSize [static, protected]

maximum number of textures per fbo

GLuint iso::gl::FrameBufferObject::mId [protected]

maximum size of fbo

math::Vector2<GLsizei> iso::gl::FrameBufferObject::mSize [protected]

id

ColorType iso::gl::FrameBufferObject::mColorType [protected]

size of offscreen rendering buffer

DataType iso::gl::FrameBufferObject::mDataType [protected]

internal color format

Texture** iso::gl::FrameBufferObject::mTextures [protected]

data type

GLuint iso::gl::FrameBufferObject::mDepthBuffer [protected]

all attached textures

GLuint iso::gl::FrameBufferObject::mStencilBuffer [protected]

depth buffer

GLuint* iso::gl::FrameBufferObject::mDrawBuffers [protected]

stencil buffer

unsigned int iso::gl::FrameBufferObject::mDrawBufferCount [protected]

draw buffers

bool* iso::gl::FrameBufferObject::mTextureCreationFlags [protected]

number of currently available draw buffers

bool iso::gl::FrameBufferObject::mColorFlag [protected]

flags indicating whether textures have been created by the fbo


The documentation for this class was generated from the following files:
Generated on Fri Feb 25 14:01:56 2011 for iso_gl by  doxygen 1.5.1