Clear all warnings

This commit is contained in:
2021-05-17 23:23:10 +02:00
parent 69f915a894
commit 44f239c673
22 changed files with 176 additions and 202 deletions
+4 -13
View File
@@ -12,12 +12,10 @@ import Control.Concurrent
import Control.Exception
import Control.Monad
import System.Mem
import Foreign.C
--import Foreign.C
import SDL
import qualified Graphics.Rendering.OpenGL as GL
import Control.Lens ((.~),(&),(+~))
--import Control.Lens ((.~),(&),(+~))
-- | Create a game loop with an SDL window.
setupLoop
:: (Int,Int) -- ^ The window size.
@@ -78,19 +76,12 @@ doLoop
performGC
endTicks <- ticks -- it might be better to use System.Clock (monotonic)
let delay = max 0 (20 + fromIntegral startTicks - fromIntegral endTicks)
threadDelay (delay * 1000 )
let theDelay = max 0 (20 + fromIntegral startTicks - fromIntegral endTicks)
threadDelay (theDelay * 1000 )
doLoop window updatedWorld worldSideEffects eventFn worldUpdate newParams
Nothing -> return ()
applyEventsIO
:: (world -> Event -> Maybe world)
-> world
-> [Event]
-> IO (Maybe world)
applyEventsIO fn w = foldM (applyEventIO fn) (Just w)
-- | Handle quit events in a manner to exit the loop. Other events handled as
-- determined by the custom function, although resize events also change the viewport.
applyEventIO :: (world -> Event -> Maybe world) -> Maybe world -> Event -> IO (Maybe world)