GLPointRenderer Class Reference

A Renderer drawing drawing particles as openGL points. More...

Inheritance diagram for GLPointRenderer:
GLRenderer PointRendererInterface GLExtHandler Renderer Registerable BufferHandler

List of all members.

Public Member Functions

 GLPointRenderer (float size=1.0f)
 Constructor of GLPointRenderer.
virtual bool setType (PointType type)
 Sets the type of points to use in this PointRendererInterface.
void setTexture (GLuint textureIndex)
 Sets the texture of this GLPointRenderer.
bool enableWorldSize (bool worldSizeEnabled)
 Sets the way size of points is computed in this GLPointRenderer.
GLuint getTexture () const
 Gets the texture of this GLPointRenderer.
bool isWorldSizeEnabled () const
 Tells whether world size is enabled or not in this GLPointRenderer.
virtual void render (const Group &group)
 Renders a Group of particles.

Static Public Member Functions

static GLPointRenderercreate (float size=1.0f)
 Creates and registers a new GLPointRenderer.

Detailed Description

A Renderer drawing drawing particles as openGL points.

OpenGL points can be configured to render them in 3 different ways :

Moreover, points size can either be defined in screen space (in pixels) or in the universe space (must be supported by the hardware). The advantage of the universe space is that points size on the screen will be dependant to their distance to the camera, whereas in screen space all points will have the same size on the screen no matter their distance to the camera.
Below are the parameters of Particle that are used in this Renderer (others have no effects) :

Definition at line 56 of file SPK_GLPointRenderer.h.


Constructor & Destructor Documentation

GLPointRenderer ( float  size = 1.0f  ) 

Constructor of GLPointRenderer.

Parameters:
size : the size of the points

Member Function Documentation

GLPointRenderer * create ( float  size = 1.0f  )  [static]

Creates and registers a new GLPointRenderer.

Parameters:
size : the size of the points
Returns:
A new registered GLPointRenderer
Since:
1.04.00

Definition at line 140 of file SPK_GLPointRenderer.h.

bool enableWorldSize ( bool  worldSizeEnabled  ) 

Sets the way size of points is computed in this GLPointRenderer.

if universe size is used (true), the extension is checked.
if universe size is not supported by the hardware, false is returned and nothing happens.

If world size is enabled, the static method setPixelPetUnit(float,int) must be called to set the conversion between pixels and world units.

Parameters:
worldSizeEnabled : true to enable universe size, false to use screen size
Returns:
true the type of size can be set, false otherwise
GLuint getTexture (  )  const

Gets the texture of this GLPointRenderer.

Returns:
the texture of this GLPointRenderer

Definition at line 152 of file SPK_GLPointRenderer.h.

bool isWorldSizeEnabled (  )  const

Tells whether world size is enabled or not in this GLPointRenderer.

Returns:
true if world size is enabled, false if not

Definition at line 157 of file SPK_GLPointRenderer.h.

virtual void render ( const Group group  )  [virtual]

Renders a Group of particles.

Parameters:
group : the Group to render

Implements Renderer.

void setTexture ( GLuint  textureIndex  ) 

Sets the texture of this GLPointRenderer.

Note that the texture is only used if point sprites are used (type is set to SPK::POINT_SPRITE)

Parameters:
textureIndex : the index of the openGL texture of this GLPointRenderer

Definition at line 147 of file SPK_GLPointRenderer.h.

virtual bool setType ( PointType  type  )  [virtual]

Sets the type of points to use in this PointRendererInterface.

If the type is not supported by the platform, false is returned and the type per default is set.

Parameters:
type : the type of points to use in this PointRendererInterface
Returns:
true if the type can be set, false otherwise

Reimplemented from PointRendererInterface.


Generated on Wed Apr 27 21:09:26 2011 for SPARK Particle Engine by  doxygen 1.6.1