Developer Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
ACG::ScreenQuad Class Reference

#include <ACG/GL/ScreenQuad.hh>

Public Member Functions

 ~ScreenQuad ()
 Destructor.
 

Static Public Member Functions

static void draw (GLSL::Program *_prog=0)
 Draw the screen quad. More...
 
static void drawInstanced (int _count, GLSL::Program *_prog=0)
 Draw the screen quad with instancing. More...
 
static void drawTexture2D (GLuint _texture, const Vec2f &_offset=Vec2f(0.0f, 0.0f), const Vec2f &_size=Vec2f(1.0f, 1.0f))
 Draw a 2D texture to screen. More...
 

Private Member Functions

 ScreenQuad ()
 Default constructor.
 
void init ()
 Initialize vbo and format.
 
void intDraw (GLSL::Program *_prog, int _numInstances=0)
 Internal draw function.
 

Static Private Member Functions

static ScreenQuadinstance ()
 Get singleton instance.
 

Private Attributes

GLuint vbo_
 vbo containing the quad in projected coordinates
 
VertexDeclarationdecl_
 vertex format of screen quad (float2 pos)
 
GLSL::ProgramtexDrawProg_
 Simple texture drawing shader.
 

Detailed Description

This class provides a simple method to draw a screen-aligned quad.

Definition at line 74 of file ScreenQuad.hh.

Member Function Documentation

void ACG::ScreenQuad::draw ( GLSL::Program _prog = 0)
static

Draw the screen quad.

The quad is in projected space with coordinates in [-1, 1].

Parameters
_progGLSL shader to bind attribute id's if needed. Pass null-pointer for fixed function rendering

Definition at line 141 of file ScreenQuad.cc.

void ACG::ScreenQuad::drawInstanced ( int  _count,
GLSL::Program _prog = 0 
)
static

Draw the screen quad with instancing.

Can be used for render to 2D-array / 3D volume The quad is in projected space with coordinates in [-1, 1].

Parameters
_countnumber of instances
_progGLSL shader to bind attribute id's if needed. Pass null-pointer for fixed function rendering

Definition at line 153 of file ScreenQuad.cc.

void ACG::ScreenQuad::drawTexture2D ( GLuint  _texture,
const Vec2f _offset = Vec2f(0.0f, 0.0f),
const Vec2f _size = Vec2f(1.0f, 1.0f) 
)
static

Draw a 2D texture to screen.

Useful for debugging, copying a texture..

Parameters
_textureTexture that should be bound when drawing the quad
_offsetOffset passed to the uniform called offset in the shader
_sizeSize passed to the uniform called size in the shader

Definition at line 200 of file ScreenQuad.cc.


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