~alcinnz/haphaestus

53f0662a4334e469053714dd2aea2bb7394a7872 — Adrian Cochrane 1 year, 1 month ago e414e86
Keep the SDL window open!
1 files changed, 11 insertions(+), 1 deletions(-)

M src/Main.hs
M src/Main.hs => src/Main.hs +11 -1
@@ 141,4 141,14 @@ main = do
    w <- createWindow "Typograffiti" wcfg
    _ <- glCreateContext w

    putStrLn "Hello, Haskell!"
    fix $ \loop -> do
        events <- fmap eventPayload <$> pollEvents
        liftIO $ glClearColor 0 0 0 1
        liftIO $ glClear GL_COLOR_BUFFER_BIT

        sz@(V2 dw dh) <- liftIO $ glGetDrawableSize w
        liftIO $ glViewport 0 0 (fromIntegral dw) (fromIntegral dh)

        liftIO $ glSwapWindow w
        unless (QuitEvent `elem` events) loop
    return ()