I forgot to mention my OS, I'm using Mac OS X 10.5.8
On Aug 28, 12:41 am, Guillaume Simard <[email protected]> wrote: > Hi everyone, > In my current application, I am using > > def update(dt): > # update stuff > > pyglet.clock.schedule_interval(update, 1.0 / 60.0) > > and > > @window.event > def on_draw(): > # draw stuff > > for my basic "game loop" (drawing and updating the game). My needs are > simple. I want "update" and "draw" to be called approximatively 60 > times per second. > However, I've been having a lot of issues with this way of doing > things even though the documentation seems to recommend it. > > First, if vsync is enabled, update will be called with varying > timesteps. Even though it should be called around 60 times per second, > I often end up with a call every 30th of a second and get an average > update per second varying between 30 and 60. > > Disabling vsync fixes that issue and gives me a constant 60 update per second. > > Second, if I disable vsync, my draws per second (fps) become very > high. Averaging around 400 fps. > This is problematic since my extremely simple game now takes up over > 80% of my cpu. > > I tried using pyglet.clock.set_fps_limit() but it doesn't seem to be > doing anything. > > The recommended way of doing a "game loop" is simple and I can see the > advantages. However, I'd like to have more control over it. > Has anyone experienced similar problems ? > Am I doing something wrong ? > > Thanks in advance for the help ! > > -- > Guillaume S. > guisim.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
