Hi everyone.
For the past few months, I've been slowly working on an audio-only game 
using pyglet. It's gone well so far, and I've learned a lot (I'm not new to 
programming, but I am new to making games).
I'm now to the point where I'd like to integrate native dialogs into the 
game (using wx); from what I've read around the net, this isn't a 
particularly new concept. The difference in my case is that I don't need 
any open gl stuff between wx or pyglet.
I've seen a few examples of an externally driven main loop here on the 
mailing list (most notably using twisted's 'coiterate' function), but my 
attempts don't work, or are unreliable.
I have a function that can be repeatedly called by a wx.Timer, which 
*should* drive pyglet's loop.
I'm not using pyglet.app.run(), just scheduling my function with a wx timer 
and starting wx's loop.

The problem with it is that it won't handle events. I've tried calling the 
nonblocking loop iterating function every 50 ms, 5 ms, 10 ms... At this 
point I'm confused and slightly annoyed. I'm just using my game's main menu 
navigation (using arrow keys) to test. The code of my attempted loop 
function is below, any help getting this working would be greatly 
appreciated.

def pyglet_event_loop(*a, **k):
    """Pyglet's main loop, abstracted out to a single function that can be 
called repeatedly to drive the loop forward."""
    #print("Pyglet loop ran.")
    # time keeps on ticking, ticking, ticking...
    pyglet.clock.tick()
    for w in pyglet.app.windows:
        w.switch_to()
        w.dispatch_events()
        w.dispatch_event('on_draw')
        w.flip()


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