Wasabi
Public Member Functions | Friends | List of all members
WParticlesManager Class Reference

#include <WParticles.hpp>

Inheritance diagram for WParticlesManager:
WManager< WParticles >

Public Member Functions

 WParticlesManager (class Wasabi *const app)
 
WError Load ()
 
class WEffectCreateParticlesEffect (W_DEFAULT_PARTICLE_EFFECT_TYPE type) const
 
WParticlesCreateParticles (W_DEFAULT_PARTICLE_EFFECT_TYPE type, uint32_t maxParticles=5000, WParticlesBehavior *behavior=nullptr, uint32_t ID=0) const
 
- Public Member Functions inherited from WManager< WParticles >
 WManager (class Wasabi *const a)
 
bool RegisterChangeCallback (std::string name, std::function< void(WParticles *, bool)> callback)
 
void RemoveChangeCallback (std::string name)
 
void AddEntity (WParticles *entity)
 
bool RemoveEntity (WParticles *entity)
 
void OnEntityNameChanged (WParticles *entity, std::string oldName)
 
virtual void Init ()
 
WParticlesGetEntity (uint32_t ID) const
 
WParticlesGetEntity (std::string name) const
 
WParticlesGetEntityByIndex (uint32_t index) const
 
uint32_t GetEntitiesCount (void) const
 

Friends

class WParticles
 

Additional Inherited Members

- Public Attributes inherited from WManager< WParticles >
class Wasabi *const m_app
 
- Protected Attributes inherited from WManager< WParticles >
std::vector< WParticles * > m_entities [W_HASHTABLESIZE]
 
std::unordered_map< std::string, WParticles * > m_entitiesByName
 

Detailed Description

Manager class for WParticles.

Member Function Documentation

◆ CreateParticles()

WParticles* WParticlesManager::CreateParticles ( W_DEFAULT_PARTICLE_EFFECT_TYPE  type,
uint32_t  maxParticles = 5000,
WParticlesBehavior behavior = nullptr,
uint32_t  ID = 0 
) const

Allocates and initializes a new particles system.

Parameters
typeType of the new particles system
maxParticlesMaximum number of particles that the system can render simultaneously. Pass 0 to free resources and uninitialize the system
behaviorBehavior object for this system, pass nullptr to use WDefaultParticleBehavior
IDID of the new particles system
Returns
Newly allocated particle system

◆ CreateParticlesEffect()

class WEffect* WParticlesManager::CreateParticlesEffect ( W_DEFAULT_PARTICLE_EFFECT_TYPE  type) const

Creates a WEffect that can be used to render particles

Returns
Newly allocated particle systems effect

◆ Load()

WError WParticlesManager::Load ( )

Loads the manager.

Returns
Error code, see WError.h

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