I made a very simple cpu particle system. Some notes / questions, please reply if you feel like I'm doing something wrong.
1. I made three classes for this: ParticleContainer, ParticleEmitter, ParticleUpdater. I know the whole particle system has to work really fast so I neglected many error checking in ParticleContainer methods, and made every method and data member in it private. I also made ParticleEmitter, ParticleUpdater, and Renderer friend classes so only they have access. Note that ParticleContainer works the same way as in the tutorial I linked above - everytime a particle is killed, it swaps its position with the last alive particle.
Code link.
2. I really want to create polymorphic classes of ParticleEmitter. (e.g class WaterfallEmitter : public ParticleEmitter {};) However, I know that virtual methods operate slower. Any advice / workaround?
3. Can you explain me in short how to use the transform feedback for gpu particles? I know about this tutorial but I think the author made it much more complex than it should be.
I also really hate his coding style.