Original Post
I'm designing a particle system right now and a particle manager. The particle manager has a list of all particles for every type of system, be it a gun, rain, or snow, all the particles are stored in one giant master list. The manager has a fixed size, say 5000 particles and a boolean called isAlive. When I add a particle to a system, it checks the master list for the first dead particle and uses it. My question is this: I need to sort by texture every frame, but should I also sort by isAlive every frame? What would be the most optimal way of aranging the data structures. Should I have a master list of particles, and sort? Or should I only sort by texture and iterate through the whole list only drawing alive particles. Or should I have a list of dead aprticles and alive particles. In my opinion, it would make sense to use a boolean of alive and dead, so I don't have to erase and recreate every frame because particle systems have erratic lifetime behaviors. But I'm not sure whats the best way of structing this, any help is appreciated.