A Renderer drawing drawing particles as openGL points. More...
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 GLPointRenderer * | create (float size=1.0f) |
Creates and registers a new GLPointRenderer. |
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.
GLPointRenderer | ( | float | size = 1.0f |
) |
Constructor of GLPointRenderer.
size | : the size of the points |
GLPointRenderer * create | ( | float | size = 1.0f |
) | [static] |
Creates and registers a new GLPointRenderer.
size | : the size of the points |
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.
worldSizeEnabled | : true to enable universe size, false to use screen size |
GLuint getTexture | ( | ) | const |
Gets 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.
Definition at line 157 of file SPK_GLPointRenderer.h.
virtual void render | ( | const Group & | group | ) | [virtual] |
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)
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.
type | : the type of points to use in this PointRendererInterface |
Reimplemented from PointRendererInterface.