Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import qualified Graphics.UI.GLFW as GLFW
- import Graphics.Rendering.OpenGL
- import qualified Control.Concurrent as C
- import FRP.Elerea.Param
- import Control.Monad
- main :: IO ()
- main = do
- ic <- GLFW.init
- when ic $ do
- m <- GLFW.createWindow 640 480 "ARC-1" Nothing Nothing
- case m of
- (Just win) -> do
- GLFW.makeContextCurrent m
- GLFW.setErrorCallback $ Just (\e s -> putStrLn $ unwords [show e, show s])
- GLFW.setWindowCloseCallback win $ Just (GLFW.destroyWindow)
- clearColor $= Color4 0.0 1.0 1.0 1
- loop win
- Nothing -> return ()
- GLFW.terminate
- loop :: GLFW.Window -> IO ()
- loop w = do
- --print =<< GLFW.getCursorPos w
- clear [ColorBuffer, DepthBuffer]
- GLFW.swapBuffers w
- C.threadDelay 1000000
- loop w
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement