rebase keyconfig changes

This commit is contained in:
Ross
2021-03-26 18:12:31 +00:00
parent 7ef4e5d415
commit 5620e45e0a
9 changed files with 218 additions and 70 deletions
+7 -3
View File
@@ -36,17 +36,20 @@ import qualified SDL
import qualified SDL.Mixer as Mix
import Graphics.Rendering.OpenGL hiding (color,scale,translate,rotate)
import LoadConfig
cursorVis :: Bool -> IO ()
cursorVis b = SDL.cursorVisible $= b
main :: IO ()
main = do
(sizex,sizey) <- loadConfig
keyConfig <- loadKeyConfig
setupLoop
(sizex,sizey)
(cursorVis False >> doPreload >>= resizeSpareFBO sizex sizey)
(\x -> cursorVis True >> cleanUpPreload x)
(fmap (setWindowSize sizex sizey) firstWorld)
(fmap (setWindowSize sizex sizey keyConfig) firstWorld)
( \preData w -> do
startTicks <- SDL.ticks
clear [ColorBuffer,DepthBuffer]
@@ -82,6 +85,7 @@ 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
setWindowSize :: Int -> Int -> KeyConfigSDL-> World -> World
setWindowSize x y z w = w & windowX .~ fromIntegral x
& windowY .~ fromIntegral y
& keyConfig .~ z