Hello again, I've posted a fairly clean and concise example of hierarchical data domains. In it, two different classes which are both rendered as colored triangle strips rotate themselves and change their colors and directly update the sections of the arrays that render them so as to avoid using extra memory and having to unnecessarily transfer data.
https://github.com/Permafacture/data-oriented-pyglet/blob/master/examples/data_oriented2.py Performance is a bit lower because the color changing is done by calling a method on each individual object that is subscribed to the data domain, rather than having numpy do it all at once. In this example it would be easy to have numpy do it all at once and for performance to be uncompromised, but I wanted to play with adding methods to the DataAccessors to make them more class like. So, one can operate on objects one at a time as in OOP, and later, if there is a reason to, that operation can likely be pushed to the level of the data domain for much faster vectorized processing. Thanks for reading and please provide feedback if you are interested and have a chance. -Elliot -- You received this message because you are subscribed to the Google Groups "pyglet-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/pyglet-users. For more options, visit https://groups.google.com/d/optout.
