Changing order of Groups properly

56 views
Skip to first unread message

Peter Varo

unread,
Oct 15, 2013, 7:22:12 PM10/15/13
to pyglet...@googlegroups.com
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!

Jorge Cardoso Leitão

unread,
Nov 26, 2013, 11:07:35 AM11/26/13
to pyglet...@googlegroups.com
Hi Peter.

I had this problem before, also when using groups, and I used this solution.

From the code of Batch, this seems to be the only way.

I think this should be exposed in the pyglet.graphics.Batch public API; added as issue 687.

Cheers,
Jorge

Peter Varo

unread,
Nov 26, 2013, 11:12:27 AM11/26/13
to pyglet...@googlegroups.com, pyglet...@googlegroups.com
Thanks for the reply -- but after my post, I wrote my own Batch and Group and VBO. And a few days later I wrote my own Pyglet, mostly in C interfaced with Cython -- so I guess my problem is solved now:)

P
Peter Varo
Jewelry & Product Designer
Junior Assistant Professor, MOME
+3630 330 38 78
--
You received this message because you are subscribed to a topic in the Google Groups "pyglet-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pyglet-users/Z0jnFmc1ydk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pyglet-users...@googlegroups.com.
To post to this group, send email to pyglet...@googlegroups.com.
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/groups/opt_out.
Reply all
Reply to author
Forward
0 new messages