HORIZON HASKELLDocslts/ghc-10.0.x77a86622026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 77a8662 · 2026-10-31

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.

Synopsis
newtypenewtype Manager

A framerate manager, counting frames and keeping track of time delays necessary to reach a certain target framerate.

Constructors

Instances2Eq, Show
  • Eq ManagerDefined in sdl2-gfx-0.3.0.0 · SDL.Framerate
  • Show ManagerDefined in sdl2-gfx-0.3.0.0 · SDL.Framerate
valueset :: MonadIO m => Manager -> Framerate -> m ()

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.

valuedelay :: MonadIO m => Manager -> m Int

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).