Nazara Engine  0.4
A fast, complete, cross-platform API designed for game development
Nz::ParticleFunctionRenderer Class Reference

Helper class used to provide a function as a particle renderer without going in the process of making a new class. More...

Inheritance diagram for Nz::ParticleFunctionRenderer:
Nz::ParticleRenderer Nz::RefCounted

Public Types

using Renderer = std::function< void(const ParticleGroup &, const ParticleMapper &, unsigned int, unsigned int, AbstractRenderQueue *)>
 

Public Member Functions

 ParticleFunctionRenderer (Renderer renderer)
 
 ParticleFunctionRenderer (const ParticleFunctionRenderer &)=default
 
void Render (const ParticleGroup &group, const ParticleMapper &mapper, unsigned int startId, unsigned int endId, AbstractRenderQueue *renderQueue) override final
 Calls the renderer function. More...
 
const Renderer & GetRenderer () const
 Gets the renderer function. More...
 
void SetRenderer (Renderer renderer)
 Sets the renderer function. More...
 
- Public Member Functions inherited from Nz::ParticleRenderer
 ParticleRenderer (const ParticleRenderer &renderer)
 Constructs a ParticleRenderer object by assignation. More...
 
virtual ~ParticleRenderer ()
 Destructs the object and calls OnParticleRendererRelease. More...
 
 NazaraSignal (OnParticleRendererRelease, const ParticleRenderer *)
 
- Public Member Functions inherited from Nz::RefCounted
 RefCounted (bool persistent=true)
 Constructs a RefCounted object with a persistance aspect. More...
 
 RefCounted (const RefCounted &)=delete
 
 RefCounted (RefCounted &&)=default
 
virtual ~RefCounted ()
 Destructs the object. More...
 
void AddReference () const
 Adds a reference to the object.
 
unsigned int GetReferenceCount () const
 Gets the number of references to the object. More...
 
bool IsPersistent () const
 Checks whether the object is persistent. More...
 
bool RemoveReference () const
 Removes a reference to the object. More...
 
bool SetPersistent (bool persistent=true, bool checkReferenceCount=false)
 Sets the persistence of the object. More...
 
RefCountedoperator= (const RefCounted &)=delete
 
RefCountedoperator= (RefCounted &&)=default
 

Static Public Member Functions

template<typename... Args>
static ParticleFunctionRendererRef New (Args &&... args)
 

Detailed Description

Helper class used to provide a function as a particle renderer without going in the process of making a new class.

Member Function Documentation

◆ GetRenderer()

const ParticleFunctionRenderer::Renderer & Nz::ParticleFunctionRenderer::GetRenderer ( ) const
inline

Gets the renderer function.

Returns
Renderer function responsible for particle rendering

◆ Render()

void Nz::ParticleFunctionRenderer::Render ( const ParticleGroup &  group,
const ParticleMapper mapper,
unsigned int  startId,
unsigned int  endId,
AbstractRenderQueue renderQueue 
)
finaloverridevirtual

Calls the renderer function.

Parameters
groupParticle group responsible of the particles
mapperParticle mapper, allowing constant access to the particle data
startIdThe first ID of the particle to update (inclusive)
endIdThe last ID of the particle to update (inclusive)
renderQueueThe concerned render queue that will receive drawable informations

Implements Nz::ParticleRenderer.

◆ SetRenderer()

void Nz::ParticleFunctionRenderer::SetRenderer ( Renderer  renderer)
inline

Sets the renderer function.

Remarks
The renderer function must be valid

The documentation for this class was generated from the following files: