I ended up just adding a member "_flip_count" to the window class in
\build\lib\pyglet\window\win32\__init__.py
Then in window.flip() i added the line _flip_count+=1

I also added get/set functions for flip count and now I have an easy
way to keep track of what frame I'm on.

AND I didn't have to write my own event loop. (I kind of like the
organization of dispatching events etc and just using app.run()!)

-Andrew


On Apr 3, 3:30 pm, "Alex Holkner" <[EMAIL PROTECTED]> wrote:
> Sorry, not on hand.  Have a look at the source of
> pyglet/app/__init__.py though, it should be apparent.
>
> Alex.
>
> On 4/4/08, agartland <[EMAIL PROTECTED]> wrote:
>
>
>
> >  i thought that might be the case. do you have a simple example of how
> >  to do this?
>
> >  On Apr 2, 8:21 pm, "Alex Holkner" <[EMAIL PROTECTED]> wrote:
>
> > > On 4/3/08, agartland <[EMAIL PROTECTED]> wrote:
>
> >  > >  I am developing a simple app which relies heavily on the ability to
> >  > >  synchronize with the vertical sync pulse coming from the monitor. In
> >  > >  fact the timing of every event and draw method depends on knowing
> >  > >  which frame is going to be displayed next. Since the clocks (based on
> >  > >  system time.time()) are not synchronized to the monitor "clock" this
> >  > >  is actually tricky to accomplish. I can get the display to vsync so
> >  > >  that there is no tearing, but knowing which frame is up next is what I
> >  > >  can't figure out.
>
> >  > >  Can anyone think of a way to know what frame is currently being
> >  > >  displayed on the screen? Basically I need a way to count the number of
> >  > >  times flip is called, but since I'm using the app.run() call I don't
> >  > >  ever actually call flip!
>
> >  > >  Any help is appreciated. Thanks!
>
> >  > You can override pyglet.app.EventLoop.idle() to take over the flip()
> >  > call yourself.
>
> >  > 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