VolVis::Shader::RenderTarget Class Reference

#include <RenderTarget.h>


Detailed Description

This class simplifies the use of an FBO. It creates the FBO according to some parameters and provides methods for binding it and getting its attached texture. Obviously, render targets cannot be stacked.


Public Member Functions

void bind (const Util::Camera *cam=0)
void bindTexture () const
GLuint getTexture () const
 RenderTarget (unsigned int w, unsigned int h, bool floatTex=false)
void setRenderSize (unsigned int w, unsigned int h)
void unbind ()
 ~RenderTarget ()


Constructor & Destructor Documentation

VolVis::Shader::RenderTarget::RenderTarget ( unsigned int  w,
unsigned int  h,
bool  floatTex = false 
)

Constructor. Creates a new FBO (Renderbuffer, Framebuffer and Texture).

Parameters:
w width of the rendertarget
h height of the rendertarget
floatTex if this is true, rendering is done with floats, otherwise with unsigned bytes

VolVis::Shader::RenderTarget::~RenderTarget (  ) 

Destructor. Deletes the FBO objects (renderbuffer, framebuffer, texture)


Member Function Documentation

void VolVis::Shader::RenderTarget::bind ( const Util::Camera cam = 0  ) 

This binds the rendertarget. After that all render calls will be done for the rendertarget and not for the display. If the dimension of the render target differs from the dimension of the render window, you have to provide a camera for adjusting the projection matrix.

Parameters:
cam if a cam is passed the projection matrix is adapted according to the width and height of the render target

void VolVis::Shader::RenderTarget::bindTexture (  )  const

This binds the texture which contains the content of the render target.

GLuint VolVis::Shader::RenderTarget::getTexture (  )  const

This returns the texture containing the content of the render target.

Returns:
texture id of the created texture

void VolVis::Shader::RenderTarget::setRenderSize ( unsigned int  w,
unsigned int  h 
)

Defines a new size for the rendertarget. If the size is different to the previously stored values, all objects needed for the rendertarget are newly created.

Parameters:
w new width of the render target
h new height of the render target

void VolVis::Shader::RenderTarget::unbind (  ) 

This unbinds the rendertarget. After that rendering will be done for display again.


The documentation for this class was generated from the following file:
Generated on Wed Dec 5 12:27:31 2007 for VolVis by  doxygen 1.5.1-p1