Hey guys, I've run in to some odd behavior and was wondering if anyone
has seen this before.
Basically, calling clock.schedule_interval(update, 1/60.0) results in
update(dt) being called at a rate of about 38 FPS. I know
schedule_interval isn't guaranteed to be completely accurate, but 22
FPS' worth of error seems excessive.
It's completely reproducible even in the most rudimentary of cases:

window = pyglet.window.Window()
n = 100
avg = [0]*n

def update(dt):

    #Average 1/dt over s frames
    avg[n-1] = dt
    for i in range(n-1):
        avg[i] = avg[i+1]
    try: print 1/(sum(avg)/n)
    except ZeroDivisionError: pass

pyglet.clock.schedule_interval(update, 1/60.0)

pyglet.app.run()


Running that averages out to about 38 FPS for me. Disabling vsync
raises it to 55, but it still can't make it to 60.
On the other hand, using just clock.schedule runs at 60 with vsync and
about 1900 without.

Any idea what's going on here? I've Googled about a bit but haven't
really found anything. I did find this bug entry, but I'm not sure if
it's describing the same problem or not: 
http://code.google.com/p/pyglet/issues/detail?id=445

I'm using Windows 7 64-bit with an Intel Q6600 (2.4Ghz quad-core) and
Python 2.6.
For what it's worth I never ran into that old multi-core bug where
games would all run slowly (mentioned in that bug report above). I'm
pretty sure the Q6600 came after they fixed that. I haven't tried
running it on any other machines yet; I'll do that tomorrow.

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