VFramebufferObject Class Reference

#include <VFramebufferObject.h>

List of all members.

Public Member Functions

 VFramebufferObject (int width, int height, unsigned int texturetype)
 ~VFramebufferObject ()
void init ()
void destroy ()
void bind ()
void bindWithoutClear ()
void unbind ()
unsigned int getFboHandle ()
unsigned int getTextureHandle ()
void saveImage (std::string filename)
void renderToFullScreen ()
void renderToLowerRightQuad ()
void renderToLowerLeftQuad ()
int getHeight ()
int getWidth ()

Static Public Member Functions

static void checkFramebufferObjectStatus ()
static VProgramgetRenderToScreenProgram ()
static bool initialiseDevIl ()

Static Public Attributes

static bool devIlInitialised = false

Private Member Functions

const int getNextPowerOfTwo (const int number)

Private Attributes

unsigned int m_FboHandle
unsigned int m_TextureHandle
unsigned int m_RenderBufferHandle
int m_Width
int m_Height
unsigned int m_TextureType

Static Private Attributes

static VProgram m_RenderToScreen
static bool m_ProgramLoaded = false


Detailed Description

class capsulating a simple framebufferobject for simple render - to textures

Definition at line 12 of file VFramebufferObject.h.


Constructor & Destructor Documentation

VFramebufferObject::VFramebufferObject ( int  width,
int  height,
unsigned int  texturetype 
)

constructor with given size

Definition at line 12 of file VFramebufferObject.cpp.

References getNextPowerOfTwo(), m_Height, and m_Width.

VFramebufferObject::~VFramebufferObject (  )  [inline]

default destructor

Definition at line 38 of file VFramebufferObject.h.

References destroy().


Member Function Documentation

void VFramebufferObject::checkFramebufferObjectStatus (  )  [static]

static method for fbo errorchecking

Definition at line 27 of file VFramebufferObject.cpp.

Referenced by bind(), bindWithoutClear(), init(), and unbind().

VProgram * VFramebufferObject::getRenderToScreenProgram (  )  [static]

Definition at line 54 of file VFramebufferObject.cpp.

References m_ProgramLoaded, and m_RenderToScreen.

Referenced by VImage::renderOuterScreen(), and VImage::renderToLowerRightQuad().

bool VFramebufferObject::initialiseDevIl (  )  [static]

method to initialise DevIl

Definition at line 38 of file VFramebufferObject.cpp.

Referenced by VImage::loadImage(), and saveImage().

void VFramebufferObject::init (  ) 

inits the FBO

Definition at line 66 of file VFramebufferObject.cpp.

References bind(), checkFramebufferObjectStatus(), m_FboHandle, m_Height, m_ProgramLoaded, m_RenderBufferHandle, m_RenderToScreen, m_TextureHandle, m_TextureType, m_Width, and unbind().

Referenced by VTransferFunction::interpolateTransferPoints(), QVolRendCanvas::mousePressEvent(), QVolRendCanvas::mouseReleaseEvent(), QVolRendCanvas::paintGL(), QVolRendCanvas::resizeGL(), and QVolRendCanvas::saveBigImage().

void VFramebufferObject::destroy (  ) 

destroys the FBO

Definition at line 132 of file VFramebufferObject.cpp.

References m_FboHandle, m_RenderBufferHandle, and m_TextureHandle.

Referenced by QVolRendCanvas::paintGL(), ~VFramebufferObject(), and vTimeStep::~vTimeStep().

void VFramebufferObject::bind (  ) 

binds the FBO

Definition at line 146 of file VFramebufferObject.cpp.

References checkFramebufferObjectStatus(), m_FboHandle, m_Height, m_RenderBufferHandle, m_TextureHandle, and m_Width.

Referenced by init(), VTransferFunction::interpolateTransferPoints(), QVolRendCanvas::paintGL(), and QVolRendCanvas::saveBigImage().

void VFramebufferObject::bindWithoutClear (  ) 

binds the FBO without clearing

Definition at line 161 of file VFramebufferObject.cpp.

References checkFramebufferObjectStatus(), m_FboHandle, m_Height, m_RenderBufferHandle, m_TextureHandle, and m_Width.

void VFramebufferObject::unbind (  ) 

unbinds the FBO

Definition at line 173 of file VFramebufferObject.cpp.

References checkFramebufferObjectStatus().

Referenced by init(), VTransferFunction::interpolateTransferPoints(), QVolRendCanvas::paintGL(), and QVolRendCanvas::saveBigImage().

unsigned int VFramebufferObject::getFboHandle (  )  [inline]

returns the handle to the Fbo

Returns:
unsigned int containing the handle

Definition at line 73 of file VFramebufferObject.h.

References m_FboHandle.

Referenced by VTransferFunction::interpolateTransferPoints().

unsigned int VFramebufferObject::getTextureHandle (  )  [inline]

returns the handle to the Texture

Definition at line 81 of file VFramebufferObject.h.

References m_TextureHandle.

Referenced by VTransferFunction::getGLHandle(), and vTimeStep::grabFBOData().

void VFramebufferObject::saveImage ( std::string  filename  ) 

saves the Current Image to Disc

Parameters:
filename filename of Image

Definition at line 184 of file VFramebufferObject.cpp.

References devIlInitialised, initialiseDevIl(), m_Height, m_TextureHandle, and m_Width.

Referenced by QVolRendCanvas::paintGL(), and QVolRendCanvas::saveImage().

void VFramebufferObject::renderToFullScreen (  ) 

renders the FBO to Fullscreen

Definition at line 226 of file VFramebufferObject.cpp.

References VProgram::bind(), VProgram::getUniformLocation(), m_RenderToScreen, and VProgram::release().

Referenced by QVolRendCanvas::paintGL().

void VFramebufferObject::renderToLowerRightQuad (  ) 

renders the FBO to a Lower Right Quad

Definition at line 288 of file VFramebufferObject.cpp.

References VProgram::bind(), VProgram::getUniformLocation(), m_RenderToScreen, and VProgram::release().

void VFramebufferObject::renderToLowerLeftQuad (  ) 

renders the FBO to a Lower Left Quad

Definition at line 257 of file VFramebufferObject.cpp.

References VProgram::bind(), VProgram::getUniformLocation(), m_RenderToScreen, and VProgram::release().

Referenced by VTransferFunction::renderTest().

int VFramebufferObject::getHeight (  )  [inline]

returns the Height of the FBO

Definition at line 110 of file VFramebufferObject.h.

References m_Height.

Referenced by VIcon::computeIcon(), and vTimeStep::grabFBOData().

int VFramebufferObject::getWidth (  )  [inline]

returns the Width of the FBO

Definition at line 118 of file VFramebufferObject.h.

References m_Width.

Referenced by VIcon::computeIcon(), and vTimeStep::grabFBOData().

const int VFramebufferObject::getNextPowerOfTwo ( const int  number  )  [inline, private]

returns the next power of two value to a given number

Parameters:
number number to computate power of 2
Returns:
the next power of two

Definition at line 130 of file VFramebufferObject.h.

Referenced by VFramebufferObject().


Member Data Documentation

bool VFramebufferObject::devIlInitialised = false [static]

Bool Containing if DevIl is initialised

Definition at line 21 of file VFramebufferObject.h.

Referenced by VImage::loadImage(), and saveImage().

unsigned int VFramebufferObject::m_FboHandle [private]

Handle to FBO.

Definition at line 138 of file VFramebufferObject.h.

Referenced by bind(), bindWithoutClear(), destroy(), getFboHandle(), and init().

unsigned int VFramebufferObject::m_TextureHandle [private]

Handle to Texture.

Definition at line 141 of file VFramebufferObject.h.

Referenced by bind(), bindWithoutClear(), destroy(), getTextureHandle(), init(), and saveImage().

unsigned int VFramebufferObject::m_RenderBufferHandle [private]

Handle to Renderbuffer.

Definition at line 142 of file VFramebufferObject.h.

Referenced by bind(), bindWithoutClear(), destroy(), and init().

int VFramebufferObject::m_Width [private]

Width of FBO.

Definition at line 143 of file VFramebufferObject.h.

Referenced by bind(), bindWithoutClear(), getWidth(), init(), saveImage(), and VFramebufferObject().

int VFramebufferObject::m_Height [private]

Height of FBO.

Definition at line 144 of file VFramebufferObject.h.

Referenced by bind(), bindWithoutClear(), getHeight(), init(), saveImage(), and VFramebufferObject().

unsigned int VFramebufferObject::m_TextureType [private]

Definition at line 145 of file VFramebufferObject.h.

Referenced by init().

VProgram VFramebufferObject::m_RenderToScreen [static, private]

Program to Render To Screen.

Definition at line 147 of file VFramebufferObject.h.

Referenced by getRenderToScreenProgram(), init(), renderToFullScreen(), renderToLowerLeftQuad(), and renderToLowerRightQuad().

bool VFramebufferObject::m_ProgramLoaded = false [static, private]

If Program is already loaded.

Definition at line 149 of file VFramebufferObject.h.

Referenced by getRenderToScreenProgram(), and init().


The documentation for this class was generated from the following files:
Generated on Mon Jan 21 01:15:17 2008 for FlowVis by  doxygen 1.5.4