On 26/03/13 21:58, Winston Wolff wrote:
Is the thing drawn on top determined by when on_draw is called, or by the Z 
value? I can't remember but I'd guess the Z value.

-Winston

On Mar 26, 2013, at 2:55 PM, Joseph Clark <[email protected]> wrote:

Hi all,
I've been using push_handlers() and pop_handlers() to change 'game modes' in the game I'm 
programming.  My code allows for multiple modes to be alive at once, in a stack.  For 
example, a mini-map may be active as a "pop up" over the main game display.  
The event handler stack is great for this: the mini-map's event handlers are on top, so 
they get first crack at the keyboard events, then whatever isn't captured falls to the 
next mode in the stack.
My problem is this: with the on_draw() events, I want them to go the other way. They should start at the *bottom* of the stack and then go up, so that the mini-map will be drawn on top of the regular display, and not vice-versa. Could any of you tell me the best way to make this happen for the on_draw events? I can't say that I fully understand how the event handler stack works.
Joe


You'll probably need to set the depth buffer on if you want to draw based on the Z-value ie put glEnable(GL_DEPTH_TEST) and glDisable(GL_DEPTH_TEST) around your drawing calls for your mini-map and make sure it is positioned at the front of the viewport. If that isn't useful you could have a single on_draw active that calls the drawing procedures in order.
HTH

--
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 http://groups.google.com/group/pyglet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to