diff --git a/affection.cabal b/affection.cabal index 7c16fc5..1cec0ee 100644 --- a/affection.cabal +++ b/affection.cabal @@ -102,7 +102,7 @@ library ghc-options: -Wall -- Other library packages from which modules are imported. build-depends: base >=4.9 && < 5 - , sdl2 ^>= 2.5 + , sdl2 >= 2.5 , linear , text , mtl @@ -129,7 +129,7 @@ executable example00 if flag(examples) build-depends: base >=4.9 && < 5 , affection - , sdl2 ^>= 2.5 + , sdl2 >= 2.5 , stm else buildable: False @@ -145,7 +145,7 @@ executable example01 if flag(examples) build-depends: base >=4.9 && < 5 , affection - , sdl2 ^>= 2.5 + , sdl2 >= 2.5 , stm , OpenGL , random @@ -168,7 +168,7 @@ executable example02 if flag(examples) build-depends: base >=4.9 && < 5 , affection - , sdl2 ^>= 2.5 + , sdl2 >= 2.5 , stm , OpenGL , random diff --git a/src/Affection.hs b/src/Affection.hs index e61cc93..4a62193 100644 --- a/src/Affection.hs +++ b/src/Affection.hs @@ -23,7 +23,8 @@ import qualified Graphics.GL as GLRaw import Foreign.Marshal.Array import qualified Data.ByteString as B -import qualified Data.ByteString.Char8 as B8 + +import Data.String (fromString) import System.Clock @@ -62,11 +63,12 @@ withAffection AffectionConfig{..} = do renderQuality <- SDL.get SDL.HintRenderScaleQuality when (renderQuality /= SDL.ScaleLinear) $ logIO Warn "Linear texture filtering not enabled!" + void $ liftIO (logIO Debug . fromString . show <$> (SDL.version :: IO (Integer, Integer, Integer))) -- construct window liftIO $ logIO Debug "Creating Window(s)" windows <- zip3 (map (\(x,_,_) -> x) windowConfigs) <$> mapM - (\wc -> SDL.createWindow windowTitle ((\(_,y,_) -> y) wc)) + (SDL.createWindow windowTitle . (\(_,y,_) -> y)) windowConfigs <*> pure (map (\(_,_,z) -> z) windowConfigs) @@ -74,7 +76,7 @@ withAffection AffectionConfig{..} = do _ <- SDL.glSetAttribute SDL.SDL_GL_SHARE_WITH_CURRENT_CONTEXT 1 contexts <- zip (map (\(x,_,_) -> x) windows) <$> mapM (SDL.glCreateContext . (\(_,y,_) -> y)) windows - mapM_ (\w -> flip SDL.setWindowMode ((\(_,_,z) -> z) w) ((\(_,y,_) -> y) w)) windows + mapM_ (\w -> SDL.setWindowMode ((\(_,y,_) -> y) w) ((\(_,_,z) -> z) w)) windows -- sync updates with monitor -- SDL.swapInterval $= SDL.SynchronizedUpdates -- <- causes Problems with windows liftIO $ logIO Debug "Getting Time"