Copyright | (c) Atze van der Ploeg 2015 |
---|---|
License | BSD-style |
Maintainer | atzeus@gmail.org |
Stability | provisional |
Portability | portable |
Safe Haskell | None |
Language | Haskell98 |
This module provides interoperability of FRPNow and the gloss system.
- type GEvent = Event
- type Time = Float
- runNowGloss :: Display -> Color -> Int -> (Behavior Time -> EvStream GEvent -> Now (Behavior Picture)) -> IO ()
- runNowGlossPure :: Display -> Color -> Int -> (Behavior Time -> EvStream GEvent -> Behavior (Behavior Picture)) -> IO ()
- toMouseMoves :: EvStream GEvent -> EvStream (Float, Float)
- toMousePos :: EvStream GEvent -> Behavior (Behavior (Float, Float))
- toKeysDown :: EvStream GEvent -> Behavior (Behavior (Set Key))
- filterMouseButtons :: Behavior (Set Key) -> Behavior (Set MouseButton)
Documentation
:: Display | Display mode. |
-> Color | Background color. |
-> Int | Maximum number of frames per second |
-> (Behavior Time -> EvStream GEvent -> Now (Behavior Picture)) | A now computation giving the picture to be displayed on the screen, taking the behavior of time and the eventstream of gloss events. |
-> IO () |
Run a Now computation which produced a behavior of type Picture, and draw that on screen.
:: Display | Display mode. |
-> Color | Background color. |
-> Int | Maximum number of frames per second |
-> (Behavior Time -> EvStream GEvent -> Behavior (Behavior Picture)) | A now computation giving the picture to be displayed on the screen, taking the behavior of time and the eventstream of gloss events. |
-> IO () |
Like runNowGloss
, but does not allow IO.
toMouseMoves :: EvStream GEvent -> EvStream (Float, Float) Source
Filter the mouse moves from an event stream of gloss events
toMousePos :: EvStream GEvent -> Behavior (Behavior (Float, Float)) Source
Get a behavior of the mouse position from an event stream of gloss events
toKeysDown :: EvStream GEvent -> Behavior (Behavior (Set Key)) Source
Get a behavior of the set of currently pressed keys from an event stream of gloss events
filterMouseButtons :: Behavior (Set Key) -> Behavior (Set MouseButton) Source