Hi Josh, 

I took your work and ran with it a little, to see if it could be fit into 
the existing api. So far, It seems to be going OK, but I would greatly 
appreciate your feedback on this. I'm just kinda winging it here :) 
You can find my "ordered_sprite" branch here:  
https://bitbucket.org/treehousegames/pyglet/branch/ordered_sprite

First of all, I implemented an OrderedVertexDomain which is a copy of your 
OrderedDomain. The main difference is that it has it's own vertex_lists 
list, and sorting method. It also has it's own "create" method, which 
monkey patches an "order" attribute on the vertex_list, for use by the 
sorting method. There is a simple "self.dirty" attribute that determines if 
the vertex_lists list should be sorted automatically before the next draw. 

By pushing all of that down the stack into the vertexdomain, The Sprite and 
SpriteGroup classes could be left almost original. The only addition being 
a "depth" property on the Sprite class which updates the vertex list order 
attribute, and sets the domain to "dirty" so that it will be sorted before 
the next draw. 

As for requiring all sprites to be on the same TextureAtlas for blending to 
work correctly, that is still a requirement (no way around this in OpenGL). 
However, it's up to the user to ensure this part. It would be "automatic" 
if using the pyglet.resource module. If the user doesn't use a single 
atlas, everything will still work fine - but of course sorting won't work 
because they will be in different domains. 

I haven't tested any of it yet, but I think animations and such will work 
fine since it's using the existing Groups and such. 

-Ben



On Friday, November 18, 2016 at 5:46:52 AM UTC+9, Josh wrote:
>
> Hi Ben,
>
> There's no roadblock with migrating OrderedDomains, it's just something I 
> skipped for now (similar to animation support). It will require going 
> deeper into the weeds with pyglet's allocation system, and there are some 
> aspects of that I still don't understand. 
>
> Best,
>
> Josh
>

-- 
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.

Reply via email to