advancements

This commit is contained in:
nek0 2019-01-30 06:08:38 +01:00
parent 22cff62868
commit a36ddd0cc5
3 changed files with 27 additions and 1 deletions

2
Setup.hs Normal file
View file

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

View file

@ -6,6 +6,8 @@ import Linear
import Options.Applicative import Options.Applicative
import Control.Monad
-- internal imports -- internal imports
import Util import Util
@ -19,5 +21,19 @@ main = do
SDL.initializeAll SDL.initializeAll
SDL.screenSaverEnabled SDL.$= False SDL.screenSaverEnabled SDL.$= False
disps <- SDL.getDisplays 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) 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
)

View file

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