On 24/05/11 13:17, cblack wrote:
Hi all. I'm confused by Pyglet's FPS limiter. The following code
doesn't work (i.e. fps isn't limited to 30, more like 20000), but I'm
not sure why. I know this is a trivial example, but I can't figure out
why it doesn't work.
==
window = pyglet.window.Window()
pyglet.clock.set_fps_limit(30)
fps = pyglet.clock.ClockDisplay()
@window.event
def on_draw():
window.clear()
fps.draw()
pyglet.app.run()
==
You have to tick the clock periodically to allow it to limit the fps.
Adding pyglet.clock.tick() to your on_draw might work.
HTH,
Adam.
--
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.