I'm having problems on updating the order of groups in a pyglet.graphics.Batch. I don't want to use pyglet.graphics.OrderedGroups, since I need the set_state() and unset_state() methods of the pyglet.graphics.Group. (However I tried encapsulating a order-independent Groups inside OrderedGroups and I tried to change the order of this group later, but it just turned out that I still need to reorder them inside the Batch object if any order property changed.
So at the moment I'm switching the value of an underscored flag (which is clearly not the best thing to do..) after I changed my subclassed Group object's order property:
batch._draw_list_dirty = True
So technically I'm forcing the Batch object to call self._update_draw_list(). Well, it is working, but I don't think this is the proper way to do this..
Any suggestions?
Thanks in advance!