rhine-gloss: Gloss backend for Rhine

[ bsd3, frp, library, program ] [ Propose Tags ] [ Report a vulnerability ]

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]

Flags

Manual Flags

NameDescriptionDefault
dev

Enable warnings as errors. Active on ci.

Disabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

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, 1.3, 1.4, 1.4.0.1, 1.5
Change log ChangeLog.md
Dependencies automaton, base (>=4.16 && <4.21), gloss (>=1.12), mmorph (>=1.1), monad-schedule (>=0.1), rhine (>=1.5 && <1.6), rhine-gloss, transformers (>=0.5) [details]
License BSD-3-Clause
Author Manuel Bärenz
Maintainer programming@manuelbaerenz.de
Category FRP
Source repo head: git clone https://github.com/turion/rhine.git
this: git clone https://github.com/turion/rhine.git(tag v1.5)
Uploaded by turion at 2024-11-12T19:29:46Z
Distributions NixOS:1.4.0.1, Stackage:1.5
Executables rhine-gloss-gears
Downloads 5186 total (109 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2024-11-12 [all 1 reports]

Readme for rhine-gloss-1.5

[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:

module README where

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
mainClSF = timeInfoOf sinceInit >>> arr (* 50) >>> arr gears

main :: IO ()
main = flowGloss defaultSettings 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. (On Debian-like systems, sudo apt-get install libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev should suffice.)

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