version 3.3

VRS::FrameBufferObjectGL Class Reference

Frambuffer objects represent application-created framebuffers. More...

#include <vrs/opengl/fbo/framebufferobjectgl.h>

Inheritance diagram for VRS::FrameBufferObjectGL:

VRS::MonoAttribute VRS::Attribute VRS::RenderObj VRS::SharedObj VRS::Visitable

List of all members.

Public Member Functions

 VRS_TYPEINFO (FrameBufferObjectGL, MonoAttribute)
 VRS_SERIALIZABLE (FrameBufferObjectGL)
 FrameBufferObjectGL ()
void attachRenderTarget (GLenum attachmentPoint, SO< RenderTargetGL > renderTarget, SO< BufferClearance > clearance=new BufferClearance())
void detachRenderTarget (GLenum attachmentPoint)
SO< RenderTargetGLgetAttachedRenderTarget (GLenum attachmentPoint) const
SO< BufferClearancegetBufferClearance (GLenum attachmentPoint) const
void clear (GLenum attachmentPoint)
bool isMarkedForClearance (GLenum attachmentPoint) const
void unmarkClearance (GLenum attachmentPoint)
Area size () const
SO< ImagerenderImage (SO< SceneThing > scene, GLenum attachmentPoint=GL_COLOR_ATTACHMENT0_EXT, SO< GLCanvas > canvas=NULL, const Area &area=Area())
void render (SO< SceneThing > scene, SO< GLCanvas > canvas=NULL, const Area &area=Area())
bool isValid () const
 Returns if rendering to this fbo has succeeded.
TransactionNo getLastUpdate () const
void setLastUpdate (TransactionNo)
 For internal use only. Check last modification.

Friends

class FrameBufferObjectPainterGL


Detailed Description

Frambuffer objects represent application-created framebuffers.

In contrast to window-system-provided framebuffers, application-created framebuffers are independent from the window system. Framebuffer objects enable a form of offscreen rendering to implement, e.g., render-to-texture efficiently.


Constructor & Destructor Documentation

VRS::FrameBufferObjectGL::FrameBufferObjectGL (  ) 

Framebuffer objects maintain a set of rendering destinations known as framebuffer-attachable images. These can represent GL logical buffers such as color buffers, depthbuffer, or stencilbuffer. A framebuffer-attachable image can either be a renderbuffer (RenderBufferGL), i.e., for generalized offscreen rendering, or textures (RenderTextureGL), i.e., for implementing render-to-texture. Each framebuffer-attachable image can be shared among multiple framebuffer objects. Furthermore, framebuffer-atachable images can be allocated independently and shared among multiple GL contexts. Framebuffer objects does not require a context switch for rendering to its attached images, i.e, render-to-texture and offscreen rendering in general are efficient.


Member Function Documentation

VRS::FrameBufferObjectGL::VRS_TYPEINFO ( FrameBufferObjectGL  ,
MonoAttribute   
)

VRS::FrameBufferObjectGL::VRS_SERIALIZABLE ( FrameBufferObjectGL   ) 

void VRS::FrameBufferObjectGL::attachRenderTarget ( GLenum  attachmentPoint,
SO< RenderTargetGL renderTarget,
SO< BufferClearance clearance = new BufferClearance() 
)

void VRS::FrameBufferObjectGL::detachRenderTarget ( GLenum  attachmentPoint  ) 

Attaching/detaching a texture or renderbuffer to/from the framebuffer object. Each framebuffer-attachable image, that is wrapped by 'RenderTargetGL', corresponds to a logical buffer. These are indicated by the attachment point. Valid attachment points are GL_COLOR_ATTACHMENT0_EXT .. GL_COLOR_ATTACHMENT15_EXT (the valid maximum number can be traced), GL_DEPTH_ATTACHMENT_EXT, GL_STENCIL_ATTACHMENT that indicate colorbuffers, depthbuffer, and stencilbuffer. Note that all framebuffer-attachable images must have equal size (width and height). 'BufferClearance' defines the clear policy for each individual framebuffer-attachable image.

SO<RenderTargetGL> VRS::FrameBufferObjectGL::getAttachedRenderTarget ( GLenum  attachmentPoint  )  const

Provides the framebuffer-attachable image to a specific attachment point.

SO<BufferClearance> VRS::FrameBufferObjectGL::getBufferClearance ( GLenum  attachmentPoint  )  const

Provides the clear policy to a framebuffer-attachable image, i.e., to specific attachment point.

void VRS::FrameBufferObjectGL::clear ( GLenum  attachmentPoint  ) 

If BufferClearance is WhenTriggered each attachment can be triggered manually by calling clear(). The clearance will be performed on the next push- or pop-action

bool VRS::FrameBufferObjectGL::isMarkedForClearance ( GLenum  attachmentPoint  )  const

It can be queried for each attachment if it is currently marked for clearance. This flag will be set to false when the next clearance occurs.

void VRS::FrameBufferObjectGL::unmarkClearance ( GLenum  attachmentPoint  ) 

If a buffer is not to be cleared anymore, the clearance-flag can be disabled manually.

Area VRS::FrameBufferObjectGL::size (  )  const

Returns the size of an arbitrary attached render target. Note: all render targets attached to one framebuffer object must have the same size!

SO<Image> VRS::FrameBufferObjectGL::renderImage ( SO< SceneThing scene,
GLenum  attachmentPoint = GL_COLOR_ATTACHMENT0_EXT,
SO< GLCanvas canvas = NULL,
const Area area = Area() 
)

Renders "scene" into an image using this FBO. 'attachmentPoint' defines, which buffer is copied into the resulting image (can be color, depth, stencil), 'canvas' is a reference canvas that provides an OpenGL context and 'area' defines a viewport size if different from the whole FBO. If no canvas is provided, an OffscreenCanvasGL is created internally.

Returns NULL if rendering failed.

Attention: the FBO must not be part of 'scene' already!

Currently, only color buffers can be read!

void VRS::FrameBufferObjectGL::render ( SO< SceneThing scene,
SO< GLCanvas canvas = NULL,
const Area area = Area() 
)

Renders "scene" using this FBO and thus fills the associated render targets. 'canvas' is a reference canvas that provides an OpenGL context and 'area' defines a viewport size if different from the whole FBO. If no canvas is provided, an OffscreenCanvasGL is created internally.

Attention: the FBO must not be part of 'scene' already!

bool VRS::FrameBufferObjectGL::isValid (  )  const [inline]

Returns if rendering to this fbo has succeeded.

TransactionNo VRS::FrameBufferObjectGL::getLastUpdate (  )  const [inline]

void VRS::FrameBufferObjectGL::setLastUpdate ( TransactionNo  last  )  [inline]

For internal use only. Check last modification.


Friends And Related Function Documentation

friend class FrameBufferObjectPainterGL [friend]


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

Generated on Mon May 21 06:00:20 2012 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact