An abstract class that renders particles. More...
Public Member Functions | |
Renderer () | |
Constructor of Renderer. | |
virtual | ~Renderer () |
Destructor of Renderer. | |
void | setActive (bool active) |
Sets this Renderer active or not. | |
virtual void | setBlending (BlendingMode blendMode)=0 |
Sets the blending mode of this renderer. | |
virtual void | enableRenderingHint (RenderingHint renderingHint, bool enable) |
Enables or disables a rendering hint. | |
virtual void | setAlphaTestThreshold (float alphaThreshold) |
Tells the alpha threshold to use when the ALPHA_TEST is enabled. | |
bool | isActive () const |
Tells whether this Renderer is active or not. | |
virtual bool | isRenderingHintEnabled (RenderingHint renderingHint) const |
Tells whether a rendering hint is enabled or not. | |
float | getAlphaTestThreshold () const |
Gets the alpha threhold used by the alpha test. | |
virtual void | render (const Group &group)=0 |
Renders a Group of particles. |
An abstract class that renders particles.
A renderer is used to represent particle systems.
the representation of a particle system is totally independant to its computation.
Some renderers (or renderers modes) may need some buffers be attached to the Group of particles they render.
rendering buffers are attached to groups but used by renderers. Their creation can also be given to renderer when needed.
By enabling the buffer creation with the static method enableBuffersCreation(bool), the renderer will create the buffers he needs, if not already created in the group, before rendering. If buffer creation is disabled, a group that dont have the correct buffers for the renderer, cannot be renderered, the render method of the renderer will simply exit.
Note that buffers are linked to a class of renderer, not to a given renderer object.
Moreover buffers have an inner flag that can vary function of the states of the renderer used.
Definition at line 76 of file SPK_Renderer.h.
void enableRenderingHint | ( | RenderingHint | renderingHint, | |
bool | enable | |||
) | [virtual] |
Enables or disables a rendering hint.
Note that as stated, these are only hints that may not be taken into account in all rendering APIs
renderingHint | : the renderingHint to enable or disable | |
enable | : true to enable it, false to disable it |
Reimplemented in IRRRenderer.
Definition at line 191 of file SPK_Renderer.h.
float getAlphaTestThreshold | ( | ) | const |
Gets the alpha threhold used by the alpha test.
Definition at line 214 of file SPK_Renderer.h.
bool isActive | ( | ) | const |
Tells whether this Renderer is active or not.
Definition at line 204 of file SPK_Renderer.h.
bool isRenderingHintEnabled | ( | RenderingHint | renderingHint | ) | const [virtual] |
Tells whether a rendering hint is enabled or not.
renderingHint | : the rendering hint |
Reimplemented in IRRRenderer.
Definition at line 209 of file SPK_Renderer.h.
virtual void render | ( | const Group & | group | ) | [pure virtual] |
Renders a Group of particles.
group | : the Group to render |
Implemented in IRRLineRenderer, IRRPointRenderer, IRRQuadRenderer, GLLineRenderer, GLLineTrailRenderer, GLPointRenderer, GLQuadRenderer, and SFMLRenderer.
void setActive | ( | bool | active | ) |
Sets this Renderer active or not.
An inactive Renderer will render its parent Group when a call to Group::render() is made.
However it can still be used manually by the user with render(Group&).
active | : true to activate this Renderer, false to deactivate it |
Definition at line 186 of file SPK_Renderer.h.
void setAlphaTestThreshold | ( | float | alphaThreshold | ) | [virtual] |
Tells the alpha threshold to use when the ALPHA_TEST is enabled.
The operation performs by the alpha test is greater or equal to threshold
alphaThreshold | : the alpha threshold to use for the alpha test |
Reimplemented in IRRRenderer.
Definition at line 199 of file SPK_Renderer.h.
virtual void setBlending | ( | BlendingMode | blendMode | ) | [pure virtual] |
Sets the blending mode of this renderer.
This is a generic method that allows to set most common blending modes in a generic way. However renderers can implement method to give more control over the blending mode used.
blendMode | : the blending mode to use |
Implemented in IRRRenderer, GLRenderer, and SFMLRenderer.