rhine-gloss: Wrapper to run reactive programs written in Rhine with Gloss as backend

[ bsd3, frp, library, program ] [ Propose Tags ]

This package provides a simple wrapper for the gloss library, or rather the function Graphics.Gloss.play, enabling you to write gloss applications as synchronous signal functions.


[Skip to Readme]

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.3.0.0, 0.4.0.0, 0.4.0.1, 0.4.0.4, 0.5.0.0, 0.5.0.1, 0.5.1.0, 0.6.0, 0.6.0.1, 0.7.0, 0.7.1, 0.8.0.0, 0.8.0.1, 0.8.1, 0.8.1.1, 0.9, 1.0, 1.1, 1.2
Change log ChangeLog.md
Dependencies base (>=4.7 && <5), dunai (>=0.4 && <0.5), gloss (>=1.11 && <1.12), rhine (>=0.4 && <0.5), rhine-gloss [details]
License BSD-3-Clause
Author Manuel Bärenz
Maintainer programming@manuelbaerenz.de
Category FRP
Uploaded by turion at 2017-12-04T15:35:13Z
Distributions
Executables rhine-gloss-gears
Downloads 4667 total (65 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2017-12-04 [all 1 reports]

Readme for rhine-gloss-0.4.0.0

[back to package description]

README

This package provides a simple wrapper for the gloss library, or rather the function Graphics.Gloss.play, enabling you to write gloss applications as synchronous signal functions. An example "gears" program, which you can run as cabal run gloss-gears, now becomes as simple as:

import FRP.Rhine.Gloss


-- | Calculate a gear wheel rotated by a certain angle.
gears :: Float -> Picture
gears angle = color green $ pictures
  $ circleSolid 60
  : map (rotate angle) [ rotate (45 * n) $ rectangleSolid 20 150 | n <- [0..3] ]

-- | Rotate the gear with a constant angular velocity.
mainSyncSF :: GlossSyncSF a
mainSyncSF = timeInfoOf sinceStart >>> arr (* 50) >>> arr gears

main :: IO ()
main = flowGloss (InWindow "rhine-gloss-gears" (400, 400) (10, 10)) (greyN 0.3) 30
     $ buildGlossRhine Just mainSyncSF