Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Wrapper to write gloss
applications in Rhine, using concurrency.
Synopsis
- data GlossConcT m a
- paintIO :: MonadIO m => Picture -> GlossConcT m ()
- clearIO :: MonadIO m => GlossConcT m ()
- paintAllIO :: MonadIO m => Picture -> GlossConcT m ()
- data GlossEventClockIO = GlossEventClockIO
- data GlossSimClockIO = GlossSimClockIO
- launchGlossThread :: MonadIO m => GlossSettings -> GlossConcT m a -> m a
- flowGlossIO :: (MonadIO m, Clock (GlossConcT m) cl, GetClockProxy cl, Time cl ~ Time (In cl), Time cl ~ Time (Out cl)) => GlossSettings -> Rhine (GlossConcT m) cl () () -> m ()
- glossConcurrently :: (Clock (GlossConcT IO) cl1, Clock (GlossConcT IO) cl2, Time cl1 ~ Time cl2) => Schedule (GlossConcT IO) cl1 cl2
Documentation
data GlossConcT m a Source #
Wraps the concurrent variables needed for communication with the gloss
backend.
Instances
clearIO :: MonadIO m => GlossConcT m () Source #
Clear the canvas.
paintAllIO :: MonadIO m => Picture -> GlossConcT m () Source #
Clear the canvas and then paint.
data GlossEventClockIO Source #
Concurrently block on gloss
events.
Instances
GetClockProxy GlossEventClockIO Source # | |
Defined in FRP.Rhine.Gloss.IO | |
MonadIO m => Clock (GlossConcT m) GlossEventClockIO Source # | |
Defined in FRP.Rhine.Gloss.IO type Time GlossEventClockIO # type Tag GlossEventClockIO # | |
type Tag GlossEventClockIO Source # | |
Defined in FRP.Rhine.Gloss.IO | |
type Time GlossEventClockIO Source # | |
Defined in FRP.Rhine.Gloss.IO |
data GlossSimClockIO Source #
Concurrently block on gloss
simulation ticks.
Instances
GetClockProxy GlossSimClockIO Source # | |
Defined in FRP.Rhine.Gloss.IO | |
MonadIO m => Clock (GlossConcT m) GlossSimClockIO Source # | |
Defined in FRP.Rhine.Gloss.IO type Time GlossSimClockIO # type Tag GlossSimClockIO # initClock :: GlossSimClockIO -> RunningClockInit (GlossConcT m) (Time GlossSimClockIO) (Tag GlossSimClockIO) # | |
type Tag GlossSimClockIO Source # | |
Defined in FRP.Rhine.Gloss.IO | |
type Time GlossSimClockIO Source # | |
Defined in FRP.Rhine.Gloss.IO |
launchGlossThread :: MonadIO m => GlossSettings -> GlossConcT m a -> m a Source #
Apply this to supply the GlossConcT
effect.
Creates a new thread in which gloss
is run,
and feeds the clocks GlossEventClockIO
and GlossSimClockIO
.
Usually, this function is applied to the result of flow
,
so you can handle all occurring effects as needed.
If you only use gloss
in your whole signal network,
you can use flowGlossIO
instead.
flowGlossIO :: (MonadIO m, Clock (GlossConcT m) cl, GetClockProxy cl, Time cl ~ Time (In cl), Time cl ~ Time (Out cl)) => GlossSettings -> Rhine (GlossConcT m) cl () () -> m () Source #
Run a Rhine
in the GlossConcT
monad by launching a separate thread for the gloss
backend,
and reactimate in the foreground.
glossConcurrently :: (Clock (GlossConcT IO) cl1, Clock (GlossConcT IO) cl2, Time cl1 ~ Time cl2) => Schedule (GlossConcT IO) cl1 cl2 Source #
A schedule in the GlossConcT
transformer,
supplying the same backend connection to its scheduled clocks.