[Haskell] ANN: gloss- Painless 2D vector graphics, animations and simulations.

Ben Lippmeier benl at ouroborus.net
Wed Mar 10 00:11:40 EST 2010

Gloss hides the pain of drawing simple vector graphics behind a nice data type and a few display functions. Gloss uses OpenGL and GLUT under the hood, but you won't have to worry about any of that. Get something cool on the screen in under 10 minutes.

A simple animated example is:

  import Graphics.Gloss
  main = animateInWindow "My Window" (200, 200) (10, 10) white 
       $ \time -> Rotate (time * 100) $ Color red $ Line [(0, 0), (100, 100)]

"animateInWindow" first takes the name, size, position and background color of the window. The final argument is a function from the time (in seconds) from when the program started, to a picture. Once the window is open you can pan around, zoom and rotate the animation using the mouse.

Pictures of more detailed examples are at:

Try it out now with:
  cabal update
  cabal install gloss
  cabal install gloss-examples

then right-click drag to rotate the box..


More information about the Haskell mailing list