-
Notifications
You must be signed in to change notification settings - Fork 148
Description
The "set_show_FPS" function of cocos.director is currently using pyglet.clock.ClockDisplay to show the FPS.
According to pyglet documentation:
"Deprecated. This class presents values that are often misleading, as they reflect the rate of clock ticks, not displayed framerate. Use pyglet.window.FPSDisplay instead." (http://pyglet.readthedocs.org/en/latest/api/pyglet/clock/pyglet.clock.ClockDisplay.html)
I've made a few tests, running default samples and tests from cocos, after commenting on director.py:
self.fps_display = clock.ClockDisplay()
and adding:
self.fps_display = pyglet.window.FPSDisplay(self.window)
One or two scripts stopped working, but they had no fps display by default, so I can't really tell if they crashed after inserting a fps display or because I've changed it from ClockDisplay to FPSDisplay.
The majority of them ran without any issues and the new fps display gave me supposedly more stable fps numbers.
Any reason not to use the pyglet.window.FPSDisplay? If not that should probably become the new cocos.director.fps_display.
Thanks.