On Wed, Oct 14, 2009 at 5:57 PM, Doeke <[email protected]> wrote:

>
> Hey,
>
> I'm having the exact same issues with timing. Did you ever find out
> the cause/solution of this problem?
> schedule_interval seem to fire at irregular timesteps, what's even
> more surprising:
>
> def update(dt):
>  print int(1/dt)
> pyglet.clock.schedule_interval(update, 1/50.)
>
> This seems to work correctly (it prints 49/50 fps), but if I hold down
> a button for more than a second or so, the fps suddenly drops to
> exactly 30 fps!
> With vsync=False or if the interval is a lot smaller (like 1/100.),
> this doesn't happen, but I don't want to trash the cpu...
> I'm using ubuntu linux.
>

When you are providing keyboard/mouse events, that is pretty much the
behaviour I would expect.

schedule_interval doesn't seem to make any guarantees about how often you
function will be called - and in general it can't. The operating system idle
timers that pyglet relies on should be interrupted whenever the OS needs to
deliver keyboard/mouse events to the application/window, and this will cause
schedule_interval to be thrown off.

As I see it, there are three ways to reasonably deal with this:

a) live with it, and deal with the issues it creates
b) implement your own 'busy' run loop, and thrash the CPU
c) use a real-time OS, and add real-time support to pyglet

-- 
Tristam MacDonald
http://swiftcoder.wordpress.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
-~----------~----~----~----~------~----~------~--~---

Reply via email to