Container for offscreen rendering targets. More...
#include <Framebuffer.hpp>
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 Framebuffer * | find (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 |
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
glGenFramebuffers
glDeleteFramebuffers
glBindFramebuffer
glCheckFramebufferStatus
XML Example
<framebuffer> <attachment /> <attachment /> </framebuffer> <clear />
Framebuffer | ( | const Tag & | tag | ) |
Initializes the chains in the framebuffer.
~Framebuffer | ( | ) | [virtual] |
Deletes the underlying OpenGL framebuffer object.
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.
type | Either color or depth. | |
item | Item to be attached. |
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.
NodeException | if framebuffer is not complete. |
Reimplemented from Node.
Framebuffer * find | ( | Node * | node | ) | [static] |
Finds a Framebuffer above a node.
node | Node to start looking. |
Chain * getChain | ( | const string & | name | ) | [protected, virtual] |
NodeException | if type not supported. |
GLuint getHandle | ( | ) | const [inline, virtual] |
GLint getMaxColorAttachments | ( | ) | [static] |
void remove | ( | ) | [virtual] |
Unbinds the Framebuffer.
Implements Applicable.
string toString | ( | ) | const [virtual] |
Forms a string from the object's attributes.
Reimplemented from Node.