Refactor flame draw
This commit is contained in:
+7
-4
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user