Target Class Reference
[Advanced]

Offscreen render location backed by a texture. More...

#include <Target.hpp>

Inheritance diagram for Target:
Attachment Attachable Node

List of all members.

Public Member Functions

 Target (const Tag &tag)
virtual void attach ()
virtual int getSize () const
string toString () const

Protected Member Functions

void associate ()

Private Attributes

Texture2Dtexture
string link

Detailed Description

Offscreen render location backed by a texture.

Attaches itself to a color attachment of a Framebuffer. When the framebuffer is active, any rendering done to that attachment will be stored in the Texture referenced by the target. Thus, results of one rendering pass can be referenced in a later one.

Multiple targets can be added to one framebuffer. The framebuffer will assign them sequential indices ranging from 0 to GL_MAX_COLOR_ATTACHMENTS. The built-in (but deprecated) gl_FragData array references these attachments directly, but Bind can be used to assign user-defined out variables to the attachments.

XML Name

XML Attributes

name User-defined name that can be referenced by other nodes.
link Name of the texture that backs the render target.

XML Example

   <texture name="layer0" >
   <texture name="layer1" >
     <framebuffer>
       <target link="layer0" />
       <target link="layer1" />
     </framebuffer>
   </texture>
   </texture>
 

Notes

See also:
Framebuffer
Attachment
Bind

Constructor & Destructor Documentation

Target ( const Tag tag  ) 

Initializes the link and name attributes.


Member Function Documentation

void associate (  )  [protected, virtual]

Finds the framebuffer and texture to use.

Exceptions:
NodeException if cannot find texture with correct name.
NodeException from Attachment::associate().

Reimplemented from Attachment.

void attach (  )  [virtual]

Attaches the target's texture to the framebuffer.

Note:
Assumes the framebuffer is already bound.

Implements Attachment.

int getSize (  )  const [inline, virtual]
Returns:
Width of the texture backing the render target.
string toString (  )  const [virtual]
Returns:
String comprised of the object's name and attributes.

Reimplemented from Attachment.


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