VTK
Public Member Functions | Public Attributes | List of all members
vtkOpenGLQuadHelper Class Reference

Class to make rendering a full screen quad easier. More...

#include <vtkOpenGLQuadHelper.h>

Collaboration diagram for vtkOpenGLQuadHelper:
[legend]

Public Member Functions

 vtkOpenGLQuadHelper (vtkOpenGLRenderWindow *, const char *vs, const char *fs, const char *gs)
 
 ~vtkOpenGLQuadHelper ()
 
void Render ()
 

Public Attributes

vtkShaderProgramProgram
 
vtkTimeStamp ShaderSourceTime
 
vtkOpenGLVertexArrayObjectVAO
 
unsigned int ShaderChangeValue
 

Detailed Description

Class to make rendering a full screen quad easier.

vtkOpenGLQuadHelper is designed to be used by classes in VTK that need to render a quad to the screen with a shader program. This happens often with render passes or other advanced rendering techniques.

Note that when releasing graphics resources instances of this class should be destroyed. A common use pattern is to conditionally create the instance where used and delete it in ReleaseGraphicsResources and the destructor.

Example usage:

if (!this->QuadHelper)
{
this->QuadHelper = vtkOpenGLQualHelper(renWin, vs, fs, gs);
}
renWin->GetShaderCache()->ReadyShaderProgram(this->QuadHelper->Program);
aTexture->Activate();
this->QuadHelper->Program->SetUniformi("aTexture", aTexture->GetTextureUnit());
this->QuadHelper->Render();
aTexture->Deactivate();
See also
vtkOpenGLRenderUtilities

Definition at line 54 of file vtkOpenGLQuadHelper.h.

Constructor & Destructor Documentation

vtkOpenGLQuadHelper::vtkOpenGLQuadHelper ( vtkOpenGLRenderWindow ,
const char *  vs,
const char *  fs,
const char *  gs 
)
vtkOpenGLQuadHelper::~vtkOpenGLQuadHelper ( )

Member Function Documentation

void vtkOpenGLQuadHelper::Render ( )

Member Data Documentation

vtkShaderProgram* vtkOpenGLQuadHelper::Program

Definition at line 57 of file vtkOpenGLQuadHelper.h.

vtkTimeStamp vtkOpenGLQuadHelper::ShaderSourceTime

Definition at line 58 of file vtkOpenGLQuadHelper.h.

vtkOpenGLVertexArrayObject* vtkOpenGLQuadHelper::VAO

Definition at line 59 of file vtkOpenGLQuadHelper.h.

unsigned int vtkOpenGLQuadHelper::ShaderChangeValue

Definition at line 60 of file vtkOpenGLQuadHelper.h.


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