--
This was feasible with pyglet 1.1.4, but seems to not work with pyglet 1.2dev.
Tested by modifying the test_sprite.py in cocos by
"""
director.init()
pyglet.clock.set_fps_limit(30)
director.show_FPS = True
"""
You can toogle the display of fps in cocos by pressing ctrl-x
In windows, pyglet 1.1.4 somehow tries to comply; with 1.2 dev it goes full tilt.
In theory, you can have the following fps locking status in pyglet, with or without cocos:
no locking:
(passing vsync=False when creating the Window in pyglet or passing vsync=False when calling director.init() in cocos)
You get the maximun frame rate your system can deliver
locking to vertical retrace: with vsync=True , which is the default, you get the same framerate as your monitor refresh rate
locking to a specific value:
import pyglet.clock
pyglet.clock.set_fps_limit(limit)
Note: you need to have at least one scheduled function, even if it does anything, or the framerate drops to aprox 14 fps