SFMLPointRenderer Class Reference

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

Inheritance diagram for SFMLPointRenderer:
SFMLRenderer PointRendererInterface GLExtHandler Renderer Registerable BufferHandler

List of all members.

Public Member Functions

 SFMLPointRenderer (float size=1.0f, ResizeMode mode=RESIZE_NONE)
 Constructor of SFMLPointRenderer.
bool setType (PointType type)
 Sets the type of points to use in this PointRendererInterface.
void setImage (sf::Image *image)
 Sets the image of this SFMLPointRenderer.
void setResizeMode (ResizeMode mode)
 Sets the resize mode of this SFMLPointRenderer.
sf::Image * getImage () const
 Gets the texture of this SFMLPointRenderer.
ResizeMode getResizeMode () const
 Gets the resize mode of this SFMLPointRenderer.
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 SFMLPointRenderercreate (float size=1.0f, ResizeMode mode=RESIZE_NONE)
 Creates and registers a new SFMLPointRenderer.

Protected Member Functions

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

Detailed Description

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

points can be configured to render them in 3 different ways :

Points size can be updated in function of the zoom of the SFML view using ResizeMode (either SPK_SFML::RESIZE_ZOOM_X or SPK_SFML::RESIZE_ZOOM_Y)
The zoom is constraints by the minimum and maximum dimensions of the point size (being generally 1.0f and 64.0f).
However on hardware that supports the openGL extension point parameter counteracts these limitations. The extension is automatically loaded if possible.
User can check whether the extension is available by calling SPK::GL::GLExtHandler::loadGLExtPointParameter()


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

Since:
1.01.00

Definition at line 62 of file SPK_SFMLPointRenderer.h.


Constructor & Destructor Documentation

SFMLPointRenderer ( float  size = 1.0f,
ResizeMode  mode = RESIZE_NONE 
)

Constructor of SFMLPointRenderer.

Parameters:
size : the size of this SFMLPointRenderer
mode : the resize mode of this SFMLPointRenderer

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.

SFMLPointRenderer * create ( float  size = 1.0f,
ResizeMode  mode = RESIZE_NONE 
) [static]

Creates and registers a new SFMLPointRenderer.

Parameters:
size : the size of this SFMLPointRenderer
mode : the resize mode of this SFMLPointRenderer
Returns:
A new registered SFMLPointRenderer
Since:
1.04.00

Definition at line 154 of file SPK_SFMLPointRenderer.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 texture of this SFMLPointRenderer.

Returns:
the texture of this SFMLPointRenderer

Definition at line 171 of file SPK_SFMLPointRenderer.h.

ResizeMode getResizeMode (  )  const

Gets the resize mode of this SFMLPointRenderer.

Returns:
the resize mode of this SFMLPointRenderer

Definition at line 176 of file SPK_SFMLPointRenderer.h.

void setImage ( sf::Image *  image  ) 

Sets the image of this SFMLPointRenderer.

Note that the image is only used if point sprites are used (type is set to SPK::POINT_SPRITE)

Parameters:
image : the index of the SFML Image of this SFMLPointRenderer

Definition at line 161 of file SPK_SFMLPointRenderer.h.

void setResizeMode ( ResizeMode  mode  ) 

Sets the resize mode of this SFMLPointRenderer.

Parameters:
mode : the resize mode of this SFMLPointRenderer

Definition at line 166 of file SPK_SFMLPointRenderer.h.

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.

Parameters:
type : the type of points to use in this PointRendererInterface
Returns:
true if the type can be set, false otherwise

Reimplemented from PointRendererInterface.


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