Refactor flame draw

This commit is contained in:
2021-03-24 19:51:10 +01:00
parent 3a52f3feaf
commit 7c9cba9ee1
3 changed files with 30 additions and 63 deletions
+7 -4
View File
@@ -27,6 +27,8 @@ import Preload
import Control.Concurrent
import Control.Lens
import Control.Monad (when)
import System.Random
@@ -44,10 +46,6 @@ main = do
(fmap (setWindowSize sizex sizey) firstWorld)
( \preData w -> do
startTicks <- SDL.ticks
errs <- errors
if length errs > 0
then putStrLn $ "GLerror during doLoop: " ++ (unwords $ map show errs)
else return ()
clear [ColorBuffer,DepthBuffer]
(lightTicks,timeSpentPoking) <- renderPicture' (_renderData preData)
(_cameraRot w) (_cameraZoom w)
@@ -76,6 +74,11 @@ main = do
(\w -> Just $ update w)
Mix.closeAudio
checkForGlErrors :: IO ()
checkForGlErrors = do
errs <- errors
when (length errs > 0) $ putStrLn $ "GLerror during doLoop: " ++ (unwords $ map show errs)
setWindowSize :: Int -> Int -> World -> World
setWindowSize x y w = w & windowX .~ fromIntegral x
& windowY .~ fromIntegral y