# Visualization Library A lightweight C++ OpenGL middleware for 2D/3D graphics | [Home] [Tutorials] [All Classes] [Grouped Classes]

# vl::FBORenderTarget Class Reference

Implements a framebuffer object to be used as a rendering target as specified by the GL_EXT_framebuffer_object extension. More...

`#include <FramebufferObject.hpp>`

Inheritance diagram for vl::FBORenderTarget:

List of all members.

## Public Member Functions
| ~FBORenderTarget ()
virtual const char * | className ()
| Returns the name of the class.
virtual void | bindFramebuffer ()
| Makes the framebuffer the current rendering target calling glBindFramebuffer(GL_FRAMEBUFFER, FBORenderTarget::handle()) and initializes all the previously defined attachment points.
GLenum | checkFramebufferStatus ()
| Returns 0 if no FBO support is found otherwise returns the value obtained from VL_glCheckFramebufferStatus().
void | printFramebufferError (GLenum status) const
void | create ()
void | destroy ()
void | addColorAttachment (EAttachmentPoint color_attachment, FBOAttachmentAbstract *attachment)
void | addTextureAttachment (EAttachmentPoint color_attachment, FBOAttachmentAbstract *attachment)
void | addDepthAttachment (FBOAttachmentAbstract *attachment)
void | addStencilAttachment (FBOAttachmentAbstract *attachment)
const std::map < EAttachmentPoint, ref < FBOAttachmentAbstract > > & | fboAttachments () const
void | removeAttachment (FBOAttachmentAbstract *attachment)
void | removeAttachment (EAttachmentPoint attach_point)
void | removeAllAttachments ()
unsigned int | handle () const
## Public Attributes
std::map< EAttachmentPoint, ref< FBOAttachmentAbstract > > | mFBOAttachments
unsigned int | mHandle
## Friends
class | OpenGLContext

## Detailed Description

Implements a framebuffer object to be used as a rendering target as specified by the GL_EXT_framebuffer_object extension.

An FBORenderTarget belongs to one and only one OpenGLContext and can be created using the OpenGLContext::createFBORenderTarget() method. To render to a FBORenderTarget use the Rendering::setRenderTarget() function.

Remarks:
  Before using any method from FBORenderTarget make sure that the appropriate OpenGL rendering context is active using FBORenderTarget::openglContext()->makeCurrent()

  All the renderbuffer attachments must specify the same number of samples.

## Constructor & Destructor Documentation

vl::FBORenderTarget::~FBORenderTarget | ( |  | ) | `[inline]`

## Member Function Documentation

virtual const char* vl::FBORenderTarget::className | ( |  | ) | `[inline, virtual]`

Returns the name of the class.

Reimplemented from vl::RenderTarget.

void FBORenderTarget::bindFramebuffer | ( |  | ) | `[virtual]`

Makes the framebuffer the current rendering target calling glBindFramebuffer(GL_FRAMEBUFFER, FBORenderTarget::handle()) and initializes all the previously defined attachment points.

Reimplemented from vl::RenderTarget.

GLenum FBORenderTarget::checkFramebufferStatus | ( |  | ) |

Returns 0 if no FBO support is found otherwise returns the value obtained from VL_glCheckFramebufferStatus().

void FBORenderTarget::printFramebufferError | ( | GLenum | status | ) | const

void vl::FBORenderTarget::create | ( |  | ) | `[inline]`

void vl::FBORenderTarget::destroy | ( |  | ) | `[inline]`

void FBORenderTarget::addColorAttachment | ( | EAttachmentPoint | color_attachment,
|  | FBOAttachmentAbstract * | attachment |
| ) |  |  |

void FBORenderTarget::addTextureAttachment | ( | EAttachmentPoint | color_attachment,
|  | FBOAttachmentAbstract * | attachment |
| ) |  |  |

void FBORenderTarget::addDepthAttachment | ( | FBOAttachmentAbstract * | attachment | ) |

void FBORenderTarget::addStencilAttachment | ( | FBOAttachmentAbstract * | attachment | ) |

const std::map< EAttachmentPoint, ref<FBOAttachmentAbstract> >& vl::FBORenderTarget::fboAttachments | ( |  | ) | const`[inline]`

void FBORenderTarget::removeAttachment | ( | FBOAttachmentAbstract * | attachment | ) |

void FBORenderTarget::removeAttachment | ( | EAttachmentPoint | attach_point | ) |

void FBORenderTarget::removeAllAttachments | ( |  | ) |

unsigned int vl::FBORenderTarget::handle | ( |  | ) | const`[inline]`

## Friends And Related Function Documentation

friend class OpenGLContext`[friend]`

Reimplemented from vl::RenderTarget.

## Member Data Documentation

std::map< EAttachmentPoint, ref<FBOAttachmentAbstract> > vl::FBORenderTarget::mFBOAttachments

unsigned int vl::FBORenderTarget::mHandle

The documentation for this class was generated from the following files:

- E:/VisualizationLibrary/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vl/FramebufferObject.hpp
- E:/VisualizationLibrary/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vl/FramebufferObject.cpp

Visualization Library v2009.08 Reference Documentation
Copyright 2005-2009 Michele Bosi. All rights reserved.
Updated on Sun Nov 8 14:28:58 2009.
Permission is granted to use this page to write and publish articles regarding Visualization Library.