Txema Vicente wrote:
> Why don't I get a constant clock.tick?
> It is double 3 times in a second in my PC(win32).
> May be due to ECC RAM?
>   
You shouldn't depend on clock.tick to be constant.
It's variable so it can keep the fps constant as the workload of your 
program as well as other programs on your system fluctuate.
It's pretty surprising that it's constant at all.
that's why you calculate dt, so you know the change.  If clock.tick were 
constant  the value wouldn't be necessary,
you'd just divide 1000 ms by the FPS limit and you'd get your ms/frame.
> #Tick Test Graph
> #------------------------------------------
> from pyglet.gl import *
> from pyglet import window
> import pyglet.clock
>
> win = window.Window(width=1000,height=200)
> clock=pyglet.clock.Clock()
> clock.set_fps_limit(60)
> x=0
> sy=4000
> while not win.has_exit:
>     win.dispatch_events()
>     dt=clock.tick()
>     glBegin(GL_LINES)
>     glVertex2f(x,0)
>     glVertex2f(x,dt*sy)
>     glEnd()
>     x+=1
>     win.flip()
> >
>
>   


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