Framebuffer Class Reference
[Advanced]

Container for offscreen rendering targets. More...

#include <Framebuffer.hpp>

Inheritance diagram for Framebuffer:
Node Applicable

List of all members.

Public Member Functions

 Framebuffer (const Tag &tag)
virtual ~Framebuffer ()
virtual bool areChildrenSelectable () const
virtual void apply ()
virtual void enqueue (const string &type, Attachable *item)
virtual GLuint getHandle () const
virtual void remove ()
virtual string toString () const

Static Public Member Functions

static Framebufferfind (Node *node)
static GLint getMaxColorAttachments ()

Protected Member Functions

virtual void associate ()
virtual void attach (Chain &chain)
virtual void finalize ()
virtual Chain * getChain (const string &name)

Private Attributes

GLuint handle
map< string, Chain > chains

Detailed Description

Container for offscreen rendering targets.

Replaces the default framebuffer with an external framebuffer object comprised of a number of attachments. When the framebuffer is active, rendering will be redirected to these attachments instead of the screen. Thus framebuffer can be used to render in multiple passes or to perform general-purpose computations.

Framebuffer cannot be used by itself. Make sure to place one or more Attachment nodes under the framebuffer, such as Target. Also, you will need to use Outputs and Bind to direct fragments to the correct location.

XML Name

OpenGL functions

XML Example

   <framebuffer>
     <attachment />
     <attachment />
   </framebuffer>
   <clear />
 
Note:
Clear is usually needed directly after the ending framebuffer tag
Screen can be used to temporarily disable the framebuffer
See also:
Attachment
Target
Outputs
Bind
Clear
Screen

Constructor & Destructor Documentation

Framebuffer ( const Tag tag  ) 

Initializes the chains in the framebuffer.

~Framebuffer (  )  [virtual]

Deletes the underlying OpenGL framebuffer object.


Member Function Documentation

void apply (  )  [virtual]

Binds the framebuffer object.

Implements Applicable.

bool areChildrenSelectable (  )  const [inline, virtual]

Disables trying to pick children drawn into a framebuffer.

Reimplemented from Node.

void associate (  )  [protected, virtual]

Generates the underlying OpenGL framebuffer object.

Reimplemented from Node.

void attach ( Chain &  chain  )  [protected, virtual]

Attaches each attachment in a chain of attachments.

void enqueue ( const string &  type,
Attachable item 
) [virtual]

Enqueues an attachable item to be attached.

Parameters:
type Either color or depth.
item Item to be attached.
Exceptions:
NodeException if type not supported.
NodeException if maximum attachments for a slot will be exceeded.
void finalize (  )  [protected, virtual]

Attaches all the attachments and checks if the framebuffer is complete.

Exceptions:
NodeException if framebuffer is not complete.

Reimplemented from Node.

Framebuffer * find ( Node node  )  [static]

Finds a Framebuffer above a node.

Parameters:
node Node to start looking.
Returns:
pointer Pointer to the Framebuffer.
Chain * getChain ( const string &  name  )  [protected, virtual]
Returns:
Structure holding state for one type of attachment.
Exceptions:
NodeException if type not supported.
GLuint getHandle (  )  const [inline, virtual]
Returns:
Integer identifying the underlying OpenGL framebuffer object.
GLint getMaxColorAttachments (  )  [static]
Returns:
Maximum number of color attachments on this system.
void remove (  )  [virtual]

Unbinds the Framebuffer.

Implements Applicable.

string toString (  )  const [virtual]

Forms a string from the object's attributes.

Reimplemented from Node.


The documentation for this class was generated from the following files:
Generated on Wed Jun 9 01:36:35 2010 for Gander by  doxygen 1.6.3