SFMLQuadRenderer Class Reference

A Renderer drawing particles as Quads for the SFML 2D rendering engine. More...

Inheritance diagram for SFMLQuadRenderer:
SFMLRenderer QuadRendererInterface Oriented2DRendererInterface Renderer Registerable BufferHandler

List of all members.

Public Member Functions

 SFMLQuadRenderer (sf::Image *image=NULL, float scaleX=1.0f, float scaleY=1.0f)
 Constructor of SFMLQuadRenderer.
void setImage (sf::Image *image)
 Sets the image of this SFMLQuadRenderer.
virtual bool setTexturingMode (TexturingMode mode)
 Sets the texturing mode for this GLQuadRenderer.
sf::Image * getImage () const
 Gets the image of this SFMLQuadRenderer.
virtual void createBuffers (const Group &group)
 Creates the buffers for this buffer handler in the given group.
virtual void destroyBuffers (const Group &group)
 Destroys the buffers for this buffer handler in the given group.

Static Public Member Functions

static SFMLQuadRenderercreate (sf::Image *image=NULL, float scaleX=1.0f, float scaleY=1.0f)
 Creates and registers a new SFMLQuadRenderer.

Protected Member Functions

virtual bool checkBuffers (const Group &group)
 checks the buffers and prepare them

Detailed Description

A Renderer drawing particles as Quads for the SFML 2D rendering engine.

A Quad can either be rendererd with a sf::Image or not.
If an Image is set, note that its size has no influence on the rendering (unlike sf::Sprite) :

Note that to gain performance it is better to use SFMLPointRenderer with GL::POINT_SPRITE as point type if possible (meaning the extension exists on the hardware, size of particles is identical and no rotation occurs).

Below are the parameters of Particle that are used in this Renderer (others have no effects) :

Since:
1.01.00

Definition at line 59 of file SPK_SFMLQuadRenderer.h.


Constructor & Destructor Documentation

SFMLQuadRenderer ( sf::Image *  image = NULL,
float  scaleX = 1.0f,
float  scaleY = 1.0f 
)

Constructor of SFMLQuadRenderer.

Parameters:
image : the Image of this SFMLQuadRenderer
scaleX : the scale on X axis of this SFMLQuadRenderer
scaleY : the scale on Y axis of this SFMLQuadRenderer

Member Function Documentation

virtual bool checkBuffers ( const Group group  )  [protected, virtual]

checks the buffers and prepare them

This method has to be implemented in derived class that uses buffers.
true must be returned if the buffers are found and initialized, false otherwise.

Parameters:
group : the group in which to check the buffers
Returns:
true if buffers are ready, false otherwise

Reimplemented from BufferHandler.

SFMLQuadRenderer * create ( sf::Image *  image = NULL,
float  scaleX = 1.0f,
float  scaleY = 1.0f 
) [static]

Creates and registers a new SFMLQuadRenderer.

Parameters:
image : the Image of this SFMLQuadRenderer
scaleX : the scale on X axis of this SFMLQuadRenderer
scaleY : the scale on Y axis of this SFMLQuadRenderer
Returns:
A new registered SFMLQuadRenderer
Since:
1.04.00

Definition at line 152 of file SPK_SFMLQuadRenderer.h.

virtual void createBuffers ( const Group group  )  [virtual]

Creates the buffers for this buffer handler in the given group.

If the buffers for this type of buffer handler already exists within the Group, they are priorly destroyed.
The type of buffers created depends on the state of the buffer handler at the time this method is called.

This method has to be overridden in derived classes that use buffers

Parameters:
group : the Group in which to create the buffers for this buffer handler

Reimplemented from BufferHandler.

virtual void destroyBuffers ( const Group group  )  [virtual]

Destroys the buffers for this buffer handler in the given group.

if the buffers dont exist, nothing happens.

This method has to be overridden in derived classes that use buffers

Parameters:
group : the Group in which to destroy the buffers for this buffer handler

Reimplemented from BufferHandler.

sf::Image * getImage (  )  const

Gets the image of this SFMLQuadRenderer.

Returns:
the image of this SFMLQuadRenderer or NULL if no image is set

Definition at line 174 of file SPK_SFMLQuadRenderer.h.

void setImage ( sf::Image *  image  ) 

Sets the image of this SFMLQuadRenderer.

Parameters:
image : the image of this SFMLQuadRenderer or NULL not to set an image

Definition at line 159 of file SPK_SFMLQuadRenderer.h.

bool setTexturingMode ( TexturingMode  mode  )  [virtual]

Sets the texturing mode for this GLQuadRenderer.

The texturing mode defines whether or not to apply a texture and if so which type of texture to apply (2D,3D or atlas).

Note that the validity of the texturing mode depends on the rendering API below.
The method returns true if the rendering mode can be set, false if it cannot

Parameters:
mode : the texturing mode of this GLQuadRenderer
Returns:
true if the rendering mode can be set, false if it cannot

Reimplemented from QuadRendererInterface.

Definition at line 165 of file SPK_SFMLQuadRenderer.h.


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