A Renderer drawing particles as OpenGL quads. More...
Public Member Functions | |
GLQuadRenderer (float scaleX=1.0f, float scaleY=1.0f) | |
Constructor of GLQuadRenderer. | |
virtual bool | setTexturingMode (TexturingMode mode) |
Sets the texturing mode for this GLQuadRenderer. | |
GLuint | getTexture () const |
Gets the texture of this GLQuadRenderer. | |
virtual void | createBuffers (const Group &group) |
Creates the buffers for this buffer handler in the given group. | |
virtual void | destroyBuffers (const Group &group) |
Destroys the buffers for this buffer handler in the given group. | |
virtual void | render (const Group &group) |
Renders a Group of particles. | |
Static Public Member Functions | |
static GLQuadRenderer * | create (float scaleX=1.0f, float scaleY=1.0f) |
Creates and registers a new GLQuadRenderer. | |
Protected Member Functions | |
virtual bool | checkBuffers (const Group &group) |
checks the buffers and prepare them |
A Renderer drawing particles as OpenGL quads.
the orientation of the quads depends on the orientation parameters set. This orientation is computed during rendering by the CPU (further improvement of SPARK will allow to make the computation on GPU side).
Below are the parameters of Particle that are used in this Renderer (others have no effects) :
Definition at line 56 of file SPK_GLQuadRenderer.h.
GLQuadRenderer | ( | float | scaleX = 1.0f , |
|
float | scaleY = 1.0f | |||
) |
Constructor of GLQuadRenderer.
scaleX | the scale of the width of the quad | |
scaleY | the scale of the height of the quad |
virtual bool checkBuffers | ( | const Group & | group | ) | [protected, virtual] |
checks the buffers and prepare them
This method has to be implemented in derived class that uses buffers.
true must be returned if the buffers are found and initialized, false otherwise.
group | : the group in which to check the buffers |
Reimplemented from BufferHandler.
GLQuadRenderer * create | ( | float | scaleX = 1.0f , |
|
float | scaleY = 1.0f | |||
) | [static] |
Creates and registers a new GLQuadRenderer.
scaleX | the scale of the width of the quad | |
scaleY | the scale of the height of the quad |
Definition at line 152 of file SPK_GLQuadRenderer.h.
virtual void createBuffers | ( | const Group & | group | ) | [virtual] |
Creates the buffers for this buffer handler in the given group.
If the buffers for this type of buffer handler already exists within the Group, they are priorly destroyed.
The type of buffers created depends on the state of the buffer handler at the time this method is called.
This method has to be overridden in derived classes that use buffers
group | : the Group in which to create the buffers for this buffer handler |
Reimplemented from BufferHandler.
virtual void destroyBuffers | ( | const Group & | group | ) | [virtual] |
Destroys the buffers for this buffer handler in the given group.
if the buffers dont exist, nothing happens.
This method has to be overridden in derived classes that use buffers
group | : the Group in which to destroy the buffers for this buffer handler |
Reimplemented from BufferHandler.
GLuint getTexture | ( | ) | const |
Gets the texture of this GLQuadRenderer.
Definition at line 164 of file SPK_GLQuadRenderer.h.
virtual void render | ( | const Group & | group | ) | [virtual] |
virtual bool setTexturingMode | ( | TexturingMode | mode | ) | [virtual] |
Sets the texturing mode for this GLQuadRenderer.
The texturing mode defines whether or not to apply a texture and if so which type of texture to apply (2D,3D or atlas).
Note that the validity of the texturing mode depends on the rendering API below.
The method returns true if the rendering mode can be set, false if it cannot
mode | : the texturing mode of this GLQuadRenderer |
Reimplemented from QuadRendererInterface.