Skip to content

Director using deprecated pyglet class clock.ClockDisplay #255

@LukeMS

Description

@LukeMS

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions