Browse Source

advancements

master
nek0 3 years ago
parent
commit
a36ddd0cc5
  1. 2
      Setup.hs
  2. 18
      src/Main.hs
  3. 8
      src/Util.hs

2
Setup.hs

@ -0,0 +1,2 @@
import Distribution.Simple
main = defaultMain

18
src/Main.hs

@ -6,6 +6,8 @@ import Linear
import Options.Applicative
import Control.Monad
-- internal imports
import Util
@ -19,5 +21,19 @@ main = do
SDL.initializeAll
SDL.screenSaverEnabled SDL.$= False
disps <- SDL.getDisplays
putStrLn ("number of displays detected: " ++ show (length disps))
putStrLn ("Number of displays detected: " ++ show (length disps))
putStrLn ("Passed command line options: " ++ show opts)
-- set Render quality
SDL.HintrenderScaleQuality SDL.$= SDL.ScaleLinear
-- check render quality
renderQuality <- SDL.get SDL.HintRenderScaleQuality
when (renderQuality /= SDL.SclaeLinear) $
putErrLn "Linear texture filtering not enabled!"
putStrLn "Creating window(s)"
wins = map uncurry SDL.CreateWindow $ if length disps > 1
then zip
[ "Ibis - " ++ optFile options
, "Ibis - " ++ optFile options ++ " - Notes"
]
( map makeWindowConfig disps
)

8
src/Util.hs

@ -4,6 +4,8 @@ import qualified SDL
import Options.Applicative
import System.IO
-- internal imports
import Types
@ -15,6 +17,9 @@ glWindowConfig = SDL.defaultWindow
}
}
putErrLn :: String -> IO ()
putErrLn s = hputStrLn stderr s
options :: Parser Options
options = Options
<$> switch
@ -33,3 +38,6 @@ options = Options
( help "Input file"
<> metavar "FILE"
)
-- makeWindowConfig :: SDL.Display -> SDL.WindowConfig
-- makeWindowConfig d =
Loading…
Cancel
Save