RenderWindow.setFramerateLimit

Limit the framerate to a maximum fixed frequency.

If a limit is set, the window will use a small delay after each call to display() to ensure that the current frame lasted long enough to match the framerate limit.

DSFML will try to match the given limit as much as it can, but since it internally uses sleep, whose precision depends on the underlying OS, the results may be a little unprecise as well (for example, you can get 65 FPS when requesting 60).

class RenderWindow
override
void
setFramerateLimit
(
uint limit
)

Parameters

limit
Type: uint

Framerate limit, in frames per seconds (use 0 to disable limit)

Meta