Cairo-Dock  3.4.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
cairo-dock-particle-system.h File Reference

Data Structures

struct  _CairoParticle
 A particle of a particle system. More...
 
struct  _CairoParticleSystem
 A particle system. More...
 

Macros

#define cairo_dock_render_particles(pParticleSystem)
 

Typedefs

typedef struct _CairoParticle CairoParticle
 A particle of a particle system.
 
typedef struct _CairoParticleSystem CairoParticleSystem
 A particle system.
 
typedef void( CairoDockRewindParticleFunc )(CairoParticle *pParticle, double dt)
 Function that re-initializes a particle when its life is over.
 

Functions

void cairo_dock_render_particles_full (CairoParticleSystem *pParticleSystem, int iDepth)
 
CairoParticleSystemcairo_dock_create_particle_system (int iNbParticles, GLuint iTexture, double fWidth, double fHeight)
 
void cairo_dock_free_particle_system (CairoParticleSystem *pParticleSystem)
 
gboolean cairo_dock_update_default_particle_system (CairoParticleSystem *pParticleSystem, CairoDockRewindParticleFunc pRewindParticle)
 

Detailed Description

A Particle System is a set of particles that evolve according to a given model. Each particle will see its parameters change with time : direction, speed, oscillation, color, size, etc. Particle Systems fully take advantage of OpenGL and are able to render many thousands of particles at a high frequency refresh.

Macro Definition Documentation

#define cairo_dock_render_particles (   pParticleSystem)

Render all the particles of a particle system.

Parameters
pParticleSystemthe particle system.

Function Documentation

void cairo_dock_render_particles_full ( CairoParticleSystem pParticleSystem,
int  iDepth 
)

Render all the particles of a particle system with a given depth.

Parameters
pParticleSystemthe particle system.
iDepthdepth of the particles that will be rendered. If set to -1, only particles with a negative z will be rendered, if set to 1, only particles with a positive z will be rendered, if set to 0, all the particles will be rendered.
CairoParticleSystem* cairo_dock_create_particle_system ( int  iNbParticles,
GLuint  iTexture,
double  fWidth,
double  fHeight 
)

Create a particle system.

Parameters
iNbParticlesnumber of particles of the system.
iTexturetexture to map on each particle.
fWidthwidth of the system.
fHeightheight of the system.
Returns
a newly allocated particle system.
void cairo_dock_free_particle_system ( CairoParticleSystem pParticleSystem)

Destroy a particle system, freeing all the ressources it was using.

Parameters
pParticleSystemthe particle system.
gboolean cairo_dock_update_default_particle_system ( CairoParticleSystem pParticleSystem,
CairoDockRewindParticleFunc  pRewindParticle 
)

Update a particle system to the next step with a generic particle behavior model. You can write your own model depending on your needs.

Parameters
pParticleSystemthe particle system.
pRewindParticlefunction called on a particle when its life is over.
Returns
TRUE if some particles are still alive.