A System to use particle systems as SFML Drawable object. More...
Public Member Functions | |
SFMLSystem (bool worldTransformed=true, sf::RenderTarget *renderTarget=NULL) | |
Constructor of SFMLSystem. | |
void | setRenderTarget (sf::RenderTarget *target) |
Sets the RenderTarget of this SFMLSystem. | |
sf::RenderTarget * | getRenderTarget () const |
Gets the RenderTarget of this SFMLSystem. | |
bool | isWorldTransformed () const |
Tells whether this system is world transformed or not. | |
virtual bool | update (float deltaTime) |
Updates the System of the current time step. | |
virtual void | render () const |
Renders particles in the System. | |
Static Public Member Functions | |
static SFMLSystem * | create (bool worldTransformed=true, sf::RenderTarget *renderTarget=NULL) |
Creates and registers a new SFMLSystem. |
A System to use particle systems as SFML Drawable object.
An SFMLSystem is the link between SPARK and SFML library. An SFMLSystem extends the sf::Drawable class and therefore inherits its public interface. This allows to handle SPARK particle systems the same way as any SFML Drawable :
However the color and blend mode of the System is ignored and overidden by the color of Particles and the blending mode of Renderers.
An SFMLSystem typically holds SFMLRenderer but any other Renderer can be used to get desired rendering.
An SFMLSystem can be renderered in 2 ways :
In the second case, the System must hold a pointer to a RenderTarget. If not, it cannot be renderered.
In the first case, the inner pointer to a RenderTarget of the SFMLSystem is ignored as the RenderTarget is explicitely defined.
Definition at line 61 of file SPK_SFMLSystem.h.
SFMLSystem | ( | bool | worldTransformed = true , |
|
sf::RenderTarget * | renderTarget = NULL | |||
) |
Constructor of SFMLSystem.
worldTransformed | : true to emit particles in world, false to emit them localy | |
renderTarget | : the render target |
SFMLSystem * create | ( | bool | worldTransformed = true , |
|
sf::RenderTarget * | renderTarget = NULL | |||
) | [static] |
Creates and registers a new SFMLSystem.
worldTransformed | : true to emit particles in world, false to emit them localy | |
renderTarget | : the render target |
Definition at line 140 of file SPK_SFMLSystem.h.
sf::RenderTarget * getRenderTarget | ( | ) | const |
Gets the RenderTarget of this SFMLSystem.
Definition at line 152 of file SPK_SFMLSystem.h.
bool isWorldTransformed | ( | ) | const |
Tells whether this system is world transformed or not.
If a system is transformed in the world, only its emitter and zones will be transformed.
The emitted particles will remain independent from the system transformation.
If it is transformed locally, the emitted particles will be transformed as well.
Definition at line 157 of file SPK_SFMLSystem.h.
virtual void render | ( | ) | const [virtual] |
void setRenderTarget | ( | sf::RenderTarget * | target | ) |
Sets the RenderTarget of this SFMLSystem.
A RenderTarget is needed when rendering the SFMLSystem in SPARK style using render()
target | : the RenderTarget of this SFMLSystem |
Definition at line 147 of file SPK_SFMLSystem.h.