first itty bitty steps

This commit is contained in:
nek0 2016-03-25 11:43:31 +01:00
parent 0ab5a7d947
commit 8cb3dc21c4
2 changed files with 28 additions and 5 deletions

View file

@ -26,7 +26,7 @@ cabal-version: >=1.10
library
exposed-modules: Affection
extensions: OverloadedStrings
-- Modules included in this library but not exported.
-- other-modules:
@ -37,7 +37,8 @@ library
-- Other library packages from which modules are imported.
build-depends: base >=4.8 && <4.9
, sdl2
, sdl2-image
, text
-- , sdl2-image
source-repository head
type: git

View file

@ -1,6 +1,28 @@
module Affection
( someFunc
( withAllAffection
, withWindow
, withDefaultWindow
, delaySec
) where
someFunc :: IO ()
someFunc = putStrLn "someFunc"
import SDL
import Data.Text
import qualified Control.Concurrent as CC
withAllAffection :: IO () -> IO ()
withAllAffection ops = do
initializeAll
ops
quit
withWindow :: Text -> WindowConfig -> (Window -> IO ()) -> IO ()
withWindow title conf ops = do
window <- createWindow title conf
ops window
destroyWindow window
withDefaultWindow :: Text -> (Window -> IO ()) -> IO ()
withDefaultWindow title ops = withWindow title defaultWindow ops
delaySec :: Int -> IO ()
delaySec dur = delay (fromIntegral $ dur * 1000)