rhine-gloss: Gloss backend for Rhine

[ 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 signal functions.


[Skip to Readme]
Versions 0.3.0.0, 0.4.0.0, 0.4.0.1, 0.4.0.4, 0.5.0.0, 0.5.0.1
Change log ChangeLog.md
Dependencies base (>=4.9 && <4.12), dunai (==0.4.*), gloss (>=1.12 && <1.14), rhine (==0.5.*), rhine-gloss [details]
License BSD-3-Clause
Author Manuel Bärenz
Maintainer programming@manuelbaerenz.de
Category FRP
Source repo head: git clone git@github.com:turion/rhine.git
this: git clone git@github.com:turion/rhine.git(tag v0.5.0.1)
Uploaded by turion at Thu Sep 27 07:47:00 UTC 2018
Distributions NixOS:0.5.0.1
Executables rhine-gloss-gears
Downloads 680 total (24 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2018-09-27 [all 1 reports]
Hackage Matrix CI

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for rhine-gloss-0.5.0.1

[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 signal functions. An example "gears" program, which you can run as cabal run rhine-gloss-gears or stack build && stack exec rhine-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.
mainClSF :: GlossClSF a
mainClSF = timeInfoOf sinceInit >>> arr (* 50) >>> arr gears

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

Installation

Since gloss is based on OpenGL, you will need to install the same dependencies as for that. Typically, this are the GL, GLU and GLUT libraries.

When building with stack, it is assumed that you have nix-shell installed, which will automatically get these dependencies for you.