Advertisement
Guest User

Untitled

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