gloss package:rhine-gloss

Wrapper library to write gloss Gloss applications in Rhine. A pure Rhine app with gloss backend must use the GlossClock or GlossCombinedClock (from Single and Combined, respectively), since the gloss API only offers callbacks. In order to run such a reactive program, you have to use flowGloss. A more flexible alternative, at the cost of introducing IO concurrency, is the IO wrapper. There, you can combine the gloss clocks with arbitrary other IO clocks.
Rescale a gloss clock like GlossSimClockIO or GlossEventClockIO to UTCTime. Uses addUTC. For other strategies to rescale a gloss clock to UTCTime, see FRP.Rhine.Clock.Realtime.
An IO clock lifted to GlossConc.
A MonadIO clock lifted to GlossConcT.
Tick on every event.
Select the relevant events by converting them to Just a, and the irrelevant ones to Nothing.
Collect all settings that the gloss backend requires.
Rescale a gloss clock like GlossSimClockIO or GlossEventClockIO to UTCTime. This is needed for compatibility with other realtime clocks like Millisecond.
When gloss is the only effect you are using, use this monad to simplify your type signatures.
Lift an IO clock to GlossConc. See GlossConcTClock.
Effects in the gloss backend
  • Wraps the concurrent variables needed for communication with the gloss backend.
  • Adds the FreeAsyncT concurrency layer for fairer scheduling
Lift a MonadIO clock to GlossConcT. You should use this instead of IOClock, otherwise scheduling will probably not work. (This is because GlossConcT uses FreeAsyncT, but liftIO is not asynchronous.)
Concurrent variables needed to communicate with the gloss backend.
Concurrently block on gloss events. Caution: Currently, you should only add one such clock in a Rhine. If you add several GlossEventClockIO, only one will be chosen at random and receive the event. See https://github.com/turion/rhine/issues/330.
Concurrently block on gloss simulation ticks. Caution: Currently, you should only add one such clock in a Rhine. If you add several GlossSimClockIO, only one will be chosen at random and receive the event. See https://github.com/turion/rhine/issues/330.
The type of a ClSF you can implement to get a gloss app, if you chose to handle events and simulation steps in the same subsystem. You can, but don't need to paint via GlossM: You can also simply output the picture and it will be painted on top.
The overall clock of a pure rhine ClSF that can be run by gloss. It ticks both on events (tag = Just Event) and simulation steps (tag = Nothing).
A pure monad in which all effects caused by the gloss backend take place.