Skip to content

Instantly share code, notes, and snippets.

@ikedaisuke
Created April 12, 2011 17:05
Show Gist options
  • Save ikedaisuke/915931 to your computer and use it in GitHub Desktop.
Save ikedaisuke/915931 to your computer and use it in GitHub Desktop.
Rotate a square in Gloss
-- An example of Gloss
-- http://www.f13g.com/%A5%D7%A5%ED%A5%B0%A5%E9%A5%DF%A5%F3%A5%B0/Haskell/GLUT/#content_1_2
module Main where
import Graphics.Gloss
main :: IO ()
main
= animateInWindow
"GuruGuru"
(200, 200)
(10,10)
black
frame
frame :: Float -> Picture
frame time
= Color white
$ Scale 120 120
$ Rotate (time * 12 * pi)
$ Polygon [ ( 0.10, 0.10)
, (-0.10, 0.10)
, (-0.10, -0.10)
, ( 0.10, -0.10)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment