alecthomas / entityx

EntityX - A fast, type-safe C++ Entity-Component system
MIT License
2.23k stars 295 forks source link

[Question] Select components based on a specific variable value #229

Closed tgalaj closed 5 years ago

tgalaj commented 5 years ago

Hey,

Is there a way to process specific components based on a variable value? For example, I would like to do some kind of component sorting, based for example on material type (opaque or transparent) to reduce renderer state switching.

alecthomas commented 5 years ago

You're probably best-off copying the entities into a vector and sorting that.