Flint Engine
Modular C++20 2D game engine powered by SDL3
Loading...
Searching...
No Matches
Flint::ParticleEffect Class Referenceabstract

Abstract interface for a self-contained particle effect. More...

#include <flint/particles/particle-effect.h>

+ Collaboration diagram for Flint::ParticleEffect:

Public Member Functions

virtual void update (float dt)=0
 Advance the particle simulation by dt seconds.
 
virtual void render (GPURenderer &renderer, const Camera &cam, const Vec2i &screenSize)=0
 Submit particle draw calls to the renderer.
 
virtual bool isFinished () const =0
 Return true when the effect has emitted and faded all particles.
 

Detailed Description

Abstract interface for a self-contained particle effect.

Implementations manage their own simulation state and GPU resources. The owner calls update() each frame followed by render() to display the effect. isFinished() can be polled to determine when the effect can be destroyed.

Definition at line 18 of file particle-effect.h.

Member Function Documentation

◆ isFinished()

virtual bool Flint::ParticleEffect::isFinished ( ) const
pure virtual

Return true when the effect has emitted and faded all particles.

Once this returns true the owner may safely destroy this object.

◆ render()

virtual void Flint::ParticleEffect::render ( GPURenderer & renderer,
const Camera & cam,
const Vec2i & screenSize )
pure virtual

Submit particle draw calls to the renderer.

Parameters
rendererGPU renderer that will execute the draw commands.
camCamera used to transform particles to screen space.
screenSizeLogical render-target size in pixels.

◆ update()

virtual void Flint::ParticleEffect::update ( float dt)
pure virtual

Advance the particle simulation by dt seconds.

Parameters
dtDelta time since the last frame, in seconds.

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