Developer Documentation

Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
ACG::ScreenQuad Class Reference

`#include <OpenFlipper/libs_required/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 ScreenQuad & | instance ()
| Get singleton instance.

## Private Attributes
GLuint | vbo_
| vbo containing the quad in projected coordinates
VertexDeclaration * | decl_
| vertex format of screen quad (float2 pos)
GLSL::Program * | texDrawProg_
| Simple texture drawing shader.

## Detailed Description

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

Definition at line 72 of file ScreenQuad.hh.

## Member Function Documentation

## ◆ draw()

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

  _prog | GLSL shader to bind attribute id's if needed. Pass null-pointer for fixed function rendering

Definition at line 138 of file ScreenQuad.cc.

## ◆ drawInstanced()

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

  _count | number of instances
  _prog | GLSL shader to bind attribute id's if needed. Pass null-pointer for fixed function rendering

Definition at line 150 of file ScreenQuad.cc.

## ◆ drawTexture2D()

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

  _texture | Texture that should be bound when drawing the quad
  _offset | Offset passed to the uniform called offset in the shader
  _size | Size passed to the uniform called size in the shader

Definition at line 197 of file ScreenQuad.cc.

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

- OpenFlipper/libs_required/ACG/GL/ScreenQuad.hh
- OpenFlipper/libs_required/ACG/GL/ScreenQuad.cc