QuadRendererInterface Class Reference

Base Interface for rendering particles with quads. More...

Inheritance diagram for QuadRendererInterface:
GLQuadRenderer IRRQuadRenderer SFMLQuadRenderer

List of all members.

Public Member Functions

 QuadRendererInterface (float scaleX=1.0f, float scaleY=1.0f)
 Constructor of QuadRendererInterface.
virtual ~QuadRendererInterface ()
 Destructor of QuadRendererInterface.
virtual bool setTexturingMode (TexturingMode mode)
 Sets the texturing mode for this GLQuadRenderer.
void setAtlasDimensions (size_t nbX, size_t nbY)
 Sets the cut of the texture.
void setScale (float scaleX, float scaleY)
 Sets the size ratio of this GLQuadRenderer.
TexturingMode getTexturingMode () const
 Gets the texturing mode of this GLQuadRenderer.
size_t getAtlasDimensionX () const
 Gets the atlas dimension on the X axis.
size_t getAtlasDimensionY () const
 Gets the atlas dimension on the Y axis.
float getScaleX () const
 Gets the scale of the width of this GLQuadRenderer.
float getScaleY () const
 Gets the scale of the height of this GLQuadRenderer.

Detailed Description

Base Interface for rendering particles with quads.

Since:
1.04.00

Definition at line 48 of file SPK_QuadRendererInterface.h.


Constructor & Destructor Documentation

QuadRendererInterface ( float  scaleX = 1.0f,
float  scaleY = 1.0f 
)

Constructor of QuadRendererInterface.

Parameters:
scaleX the scale of the width of the quad
scaleY the scale of the height of the quad
virtual ~QuadRendererInterface (  )  [virtual]

Destructor of QuadRendererInterface.

Definition at line 68 of file SPK_QuadRendererInterface.h.


Member Function Documentation

size_t getAtlasDimensionX (  )  const

Gets the atlas dimension on the X axis.

See setAtlasDimensions(size_t,size_t) for more information

Returns:
the atlas dimension on the X axis

Definition at line 215 of file SPK_QuadRendererInterface.h.

size_t getAtlasDimensionY (  )  const

Gets the atlas dimension on the Y axis.

See setAtlasDimensions(size_t,size_t) for more information

Returns:
the atlas dimension on the Y axis

Definition at line 220 of file SPK_QuadRendererInterface.h.

float getScaleX (  )  const

Gets the scale of the width of this GLQuadRenderer.

Returns:
the scale of the width of this GLQuadRenderer

Definition at line 225 of file SPK_QuadRendererInterface.h.

float getScaleY (  )  const

Gets the scale of the height of this GLQuadRenderer.

Returns:
the scale of the height of this GLQuadRenderer

Definition at line 230 of file SPK_QuadRendererInterface.h.

TexturingMode getTexturingMode (  )  const

Gets the texturing mode of this GLQuadRenderer.

Returns:
the texturing mode of this GLQuadRenderer

Definition at line 210 of file SPK_QuadRendererInterface.h.

void setAtlasDimensions ( size_t  nbX,
size_t  nbY 
)

Sets the cut of the texture.

This is available only if SPK::PARAM_TEXTURE_INDEX is enabled and texturing mode is TEXTURE_2D.

Particles can be rendered only with a part of the texture depending on their texture index value.
The cut can only be constant.
The user defines in how many parts the texture must be divided in X and Y.
The first index is located at the top left cut, the it goes from left to right and from top to bottom.

For instance a cut with nbX = 3 and nbY = 2 will be as followed :
-------------
| 0 | 1 | 2 |
-------------
| 3 | 4 | 5 |
-------------


By default nbX and nbY are equal to 1.

Parameters:
nbX : the number of cuts in the X axis
nbY : the number of cuts in the Y axis
void setScale ( float  scaleX,
float  scaleY 
)

Sets the size ratio of this GLQuadRenderer.

These values defines how quads are scaled. The height and width of a quad in the universe is defined as followed :

  • width = size * ratioX
  • height = size * ratioY
Parameters:
scaleX : the scale of the width of the quad
scaleY : the scale of the height of the quad

Definition at line 204 of file SPK_QuadRendererInterface.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 in GLQuadRenderer, and SFMLQuadRenderer.

Definition at line 198 of file SPK_QuadRendererInterface.h.


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