A certain number of frames per second.
Modulesdl2-gfx-0.3.0.0Haskell2010
SDL.Framerate
Bindings to SDL2_gfx's framerate management functionality. These functions
should allow you to set, manage and query a target application framerate.
- 2 types
- 10 values
- Packagesdl2-gfx-0.3.0.0
- Exports12
- LanguageHaskell2010
- LicenceMIT
- SourceFramerate.hs
A framerate manager, counting frames and keeping track of time delays necessary to reach a certain target framerate.
Create a new framerate Manager using the default settings.
You have to take care to call destroyManager yourself. It's recommended to use with instead.
Set a target framerate and reset delay interpolation.
Note that the given framerate must be within the allowed range -- otherwise the minimum or maximum allowed framerate is used instead.
Generate and apply a delay in order to maintain a constant target framerate.
This should be called once per rendering loop.
Delay will automatically be set to zero if the computer cannot keep up (if rendering is too slow). Returns the number of milliseconds since the last time delay was called (possibly zero).
Same as delay, but doesn't return the time since it was last called.
The smallest allowed framerate.
The largest allowed framerate.
Get the currently set framerate.
Returns the framecount. Each time delay is called, a frame is counted.
Frees a framerate manager. Make sure not to use it again after this action.