A Renderer drawing particles as Quads for the SFML 2D rendering engine. More...
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 SFMLQuadRenderer * | create (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 |
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) :
Definition at line 59 of file SPK_SFMLQuadRenderer.h.
SFMLQuadRenderer | ( | sf::Image * | image = NULL , |
|
float | scaleX = 1.0f , |
|||
float | scaleY = 1.0f | |||
) |
Constructor of SFMLQuadRenderer.
image | : the Image of this SFMLQuadRenderer | |
scaleX | : the scale on X axis of this SFMLQuadRenderer | |
scaleY | : the scale on Y axis of this SFMLQuadRenderer |
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.
group | : the group in which to check the buffers |
Reimplemented from BufferHandler.
SFMLQuadRenderer * create | ( | sf::Image * | image = NULL , |
|
float | scaleX = 1.0f , |
|||
float | scaleY = 1.0f | |||
) | [static] |
Creates and registers a new SFMLQuadRenderer.
image | : the Image of this SFMLQuadRenderer | |
scaleX | : the scale on X axis of this SFMLQuadRenderer | |
scaleY | : the scale on Y axis of this SFMLQuadRenderer |
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
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
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.
Definition at line 174 of file SPK_SFMLQuadRenderer.h.
void setImage | ( | sf::Image * | image | ) |
Sets the image of this SFMLQuadRenderer.
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
mode | : the texturing mode of this GLQuadRenderer |
Reimplemented from QuadRendererInterface.
Definition at line 165 of file SPK_SFMLQuadRenderer.h.