ContentsIndex
Graphics.Plot.Animate
Description
Implements callbacks and state used to draw animated pictures.
Synopsis
data AnimateState = AnimateState {
stateAnimate :: Bool
stateAnimateStart :: Bool
stateAnimateTime :: Int
stateDisplayTime :: Int
stateDisplayTimeLast :: Int
stateDisplayTimeClamp :: Int
stateGateTimeStart :: Int
stateGateTimeEnd :: Int
stateGateTimeElapsed :: Int
}
controlAnimate :: IORef AnimateState -> [Callback]
animateBegin :: IORef AnimateState -> IO ()
animateEnd :: IORef AnimateState -> IO ()
Documentation
data AnimateState
Animation State
Constructors
AnimateState
stateAnimate :: BoolWhether to call the user's draw repetedly to get an animation.
stateAnimateStart :: BoolWhether this is the first frame of the animation.
stateAnimateTime :: IntNumber of msec the animation has been running for
stateDisplayTime :: IntThe time when we entered the display callback for the current frame.
stateDisplayTimeLast :: Int
stateDisplayTimeClamp :: IntClamp the minimum time between frames to this value (in msec) Most LCD monitors refresh at around 50Hz so setting this to < 20msec probably isn't worthwhile.
stateGateTimeStart :: IntThe time when the last call to the users render function finished.
stateGateTimeEnd :: IntThe time when displayInWindow last finished (after sleeping to clamp fps).
stateGateTimeElapsed :: IntHow long it took to draw this frame
controlAnimate :: IORef AnimateState -> [Callback]
Callbacks used to run/stop the animation via the keyboard.
animateBegin :: IORef AnimateState -> IO ()
Handles animation timing details. Call this function at the start of each frame.
animateEnd :: IORef AnimateState -> IO ()
Handles animation timing details. Call this function at the end of each frame.
Produced by Haddock version 0.7