SFMLSystem Class Reference

A System to use particle systems as SFML Drawable object. More...

Inheritance diagram for SFMLSystem:
System Registerable Transformable

List of all members.

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 SFMLSystemcreate (bool worldTransformed=true, sf::RenderTarget *renderTarget=NULL)
 Creates and registers a new SFMLSystem.

Detailed Description

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.

Since:
1.01.00

Definition at line 61 of file SPK_SFMLSystem.h.


Constructor & Destructor Documentation

SFMLSystem ( bool  worldTransformed = true,
sf::RenderTarget *  renderTarget = NULL 
)

Constructor of SFMLSystem.

Parameters:
worldTransformed : true to emit particles in world, false to emit them localy
renderTarget : the render target

Member Function Documentation

SFMLSystem * create ( bool  worldTransformed = true,
sf::RenderTarget *  renderTarget = NULL 
) [static]

Creates and registers a new SFMLSystem.

Parameters:
worldTransformed : true to emit particles in world, false to emit them localy
renderTarget : the render target
Returns:
A new registered SFMLSystem
Since:
1.04.00

Definition at line 140 of file SPK_SFMLSystem.h.

sf::RenderTarget * getRenderTarget (  )  const

Gets the RenderTarget of this SFMLSystem.

Returns:
the RenderTarget of this SFMLSystem or NULL if no RenderTarget is set

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.

Returns:
true if this system is world transformed, false if not
Since:
1.03.01

Definition at line 157 of file SPK_SFMLSystem.h.

virtual void render (  )  const [virtual]

Renders particles in the System.

Note that this method renders all groups in the System from first to last.

Reimplemented from System.

void setRenderTarget ( sf::RenderTarget *  target  ) 

Sets the RenderTarget of this SFMLSystem.

A RenderTarget is needed when rendering the SFMLSystem in SPARK style using render()

Parameters:
target : the RenderTarget of this SFMLSystem

Definition at line 147 of file SPK_SFMLSystem.h.

virtual bool update ( float  deltaTime  )  [virtual]

Updates the System of the current time step.

Note that this method updates all groups in the System from first to last.

Parameters:
deltaTime : the time step
Returns:
true if the System is still active (has active groups)

Reimplemented from System.


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