SFMLLineRenderer Class Reference

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

Inheritance diagram for SFMLLineRenderer:
SFMLRenderer LineRendererInterface Renderer Registerable BufferHandler

List of all members.

Public Member Functions

 SFMLLineRenderer (float length=1.0f, float width=1.0f, ResizeMode mode=RESIZE_NONE)
 Constructor of SFMLLineRenderer.
void setResizeMode (ResizeMode mode)
 Sets the resize mode of this SFMLLineRenderer.
ResizeMode getResizeMode () const
 Gets the resize mode of this SFMLLineRenderer.
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 SFMLLineRenderercreate (float length=1.0f, float width=1.0f, ResizeMode mode=RESIZE_NONE)
 Creates and registers a new SFMLLineRenderer.

Protected Member Functions

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

Detailed Description

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

the length of the lines is function of the Particle velocity and is defined in the universe space while the width is fixed and defines in the screen space (in pixels).
The width can be zoomed with the View using resizeMode (either SPK_SFML::RESIZE_ZOOM_X or SPK_SFML::RESIZE_ZOOM_Y). However the maximum width for a line is constraints by the hardware.
Below are the parameters of Particle that are used in this Renderer (others have no effects) :

Since:
1.01.00

Definition at line 52 of file SPK_SFMLLineRenderer.h.


Constructor & Destructor Documentation

SFMLLineRenderer ( float  length = 1.0f,
float  width = 1.0f,
ResizeMode  mode = RESIZE_NONE 
)

Constructor of SFMLLineRenderer.

Parameters:
length : the length multiplier of this SFMLLineRenderer
width : the width of this SFMLLineRenderer in pixels
mode : the resize mode of this SFMLLineRenderer

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.

SFMLLineRenderer * create ( float  length = 1.0f,
float  width = 1.0f,
ResizeMode  mode = RESIZE_NONE 
) [static]

Creates and registers a new SFMLLineRenderer.

Parameters:
length : the length multiplier of this SFMLLineRenderer
width : the width of this SFMLLineRenderer in pixels
mode : the resize mode of this SFMLLineRenderer
Returns:
A new registered SFMLLineRenderer
Since:
1.04.00

Definition at line 126 of file SPK_SFMLLineRenderer.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.

ResizeMode getResizeMode (  )  const

Gets the resize mode of this SFMLLineRenderer.

Returns:
the resize mode of this SFMLLineRenderer

Definition at line 138 of file SPK_SFMLLineRenderer.h.

void setResizeMode ( ResizeMode  mode  ) 

Sets the resize mode of this SFMLLineRenderer.

Parameters:
mode : the resize mode of this SFMLLineRenderer

Definition at line 133 of file SPK_SFMLLineRenderer.h.


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