On Tue, Mar 4, 2008 at 12:46 PM, Snor <[EMAIL PROTECTED]> wrote:
>
>  I've previously used pyglet and implemented a main loop myself. As I
>  have been creating games that run at as high a frame-rate as possible,
>  I was updating the screen every frame using a routine in the main
>  event loop.
>
>  I was wondering how exactly I call code to be executed every frame
>  when using pyglet.app?

pyglet.clock.schedule()

If you want even more control, you can subclass EventLoop and override idle().

>
>  Also, I plan on using twisted with this application too, if anyone is
>  familiar with this, do you know how well this could work with
>  pyglet.app?

There was a thread from last week that produced some solutions.

>
>  Or perhaps it would be better to stick to the method I was using
>  before where twisted handles the event loop and calls pyglet to draw a
>  frame (and if pyglet has a framerate set, then it blocks for the
>  required milliseconds before handing back to twisted to check it's own
>  events - the pyglet frame drawing routine then puts itself back in the
>  twisted queue to be executed again when all the network related events
>  are taken care of)?

This will work (and is supported), but I don't recommend it.  See the
appendix in the programming guide for a list of reasons why you should
use pyglet.app.run.

Alex.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to