HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

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
typetype Framerate = Int
#

A certain number of frames per second.

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