#include <RenderTarget.h>
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 () |
VolVis::Shader::RenderTarget::RenderTarget | ( | unsigned int | w, | |
unsigned int | h, | |||
bool | floatTex = false | |||
) |
Constructor. Creates a new FBO (Renderbuffer, Framebuffer and Texture).
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)
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.
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.
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.
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.