Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <pre><code>
- 9 initGL :: IO ()
- 10 initGL = do
- 11 shadeModel $= Smooth
- 12 clearColor $= Color4 0 180 255 0
- 13 clearDepth $= 1
- 14 depthFunc $= Just Lequal
- 15 hint PerspectiveCorrection $= Nicest
- 16
- 17 drawFrame :: WindowRefreshCallback
- 18 drawFrame = return ()
- 19
- 20 keyPressed :: KeyCallback
- 21 keyPressed _ _ = return ()
- 22
- 23 close :: WindowCloseCallback
- 24 close = return True
- 25
- 26 targetFPS :: Int
- 27 targetFPS = 60
- 28
- 29 main :: IO ()
- 30 main = do
- 31 True <- initialize
- 32 True <- openWindow $ defaultDisplayOptions
- 33 { displayOptions_width = 800
- 34 , displayOptions_height = 600
- 35 , displayOptions_displayMode = Window
- 36 , displayOptions_windowIsResizable = False
- 37 }
- 38 setWindowTitle "Eria"
- 39 setWindowRefreshCallback drawFrame
- 40 setKeyCallback keyPressed
- 41 setWindowCloseCallback close
- 42
- 43 initGL
- 44
- 45 forever $ do drawFrame
- 46 swapBuffers
- 47 threadDelay $ 1000000 `div` targetFPS
- </code></pre>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement