15 : _emitRate(emitRate),
23 const F32 dt = Time::MicrosecondsToSeconds<F32>(deltaTimeUS);
26 const U32 endID = std::min(startID + maxNewParticles, data.
totalCount() - 1);
32 gen->generate(*generateTask, pool, deltaTimeUS, data, startID, endID);
35 Start(*generateTask, pool);
36 Wait(*generateTask, pool);
38 for (
U32 i = startID; i < endID; ++i) {
Rough around the edges Adapter pattern abstracting the actual rendering API and access to the GPU.
Container to store data for a given set of particles.
U32 aliveCount() const noexcept
U32 totalCount() const noexcept
ParticleSource(GFXDevice &context) noexcept
virtual void emit(U64 deltaTimeUS, const std::shared_ptr< ParticleData > &p)
vector< std::shared_ptr< ParticleGenerator > > _particleGenerators
PlatformContext & context() noexcept
TaskPool & taskPool(const TaskPoolType type) noexcept
Handle console commands that start with a forward slash.
constexpr U32 to_U32(const T value)
void Wait(const Task &task, TaskPool &pool)
Task * CreateTask(Predicate &&threadedFunction, bool allowedInIdle=true)
void Start(Task &task, TaskPool &pool, TaskPriority priority=TaskPriority::DONT_CARE, const DELEGATE< void > &onCompletionFunction={})