natiny_particles_create

C
NatinyParticles natiny_particles_create(uint32_t capacity);

Creates a particle system: an emitter entity at the world origin and room for capacity live particles. It starts emitting at once.

Parameters

Name Type Description
capacity uint32_t Most particles alive at the same time; must be above 0

Returns

Type Description
NatinyParticles Particle system handle, or 0 when capacity is 0 or memory ran out

Example

C
NatinyParticles sparks = natiny_particles_create(512);
natiny_entity_set_position(sparks, NATINY_SPACE_WORLD, 0.0f, 1.0f, 0.0f);

Notes

  • All particle memory is allocated here. Nothing allocates while the system runs; a system that is full stops spawning until particles die.