diff --git a/examples/example00.hs b/examples/example00.hs index f3092b4..f9438f6 100644 --- a/examples/example00.hs +++ b/examples/example00.hs @@ -51,7 +51,7 @@ load _ = do traceM "over" text <- G.gegl_node_new_child root $ G.textOperation [ G.Property "string" $ G.PropertyString "Hello world!" - , G.Property "color" $ G.PropertyColor $ G.RGB 0 0 1 + -- , G.Property "color" $ G.PropertyColor $ G.RGBA 0 0 1 0.1 , G.Property "size" $ G.PropertyDouble 40 ] traceM "text" diff --git a/src/Affection.hs b/src/Affection.hs index 756ef9c..3fe9a85 100644 --- a/src/Affection.hs +++ b/src/Affection.hs @@ -26,7 +26,10 @@ import Control.Concurrent.MVar import Affection.Render import Affection.Types as Types -withAffection :: AffectionConfig us -> IO () +-- | Main function which bootstraps everything else. +withAffection + :: AffectionConfig us -- ^ Configuration of the Game and its engine. + -> IO () withAffection conf@AffectionConfig{..} = do case initComponents of All -> @@ -38,7 +41,6 @@ withAffection conf@AffectionConfig{..} = do window <- SDL.createWindow windowTitle windowConfig surface <- SDL.getWindowSurface window initContainer <- return . (\x -> AffectionData - -- { affectionConfig = conf { quitEvent = False , userState = x , drawWindow = window @@ -62,6 +64,8 @@ withAffection conf@AffectionConfig{..} = do G.gegl_exit SDL.quit +-- | DEPRECATED! +-- Function for bootstraping a window. withWindow :: Monad m => T.Text -> WindowConfig -> SDL.RendererConfig -> RenderT m a -> IO () withWindow title wconf rconf ops = do window <- SDL.createWindow title wconf @@ -75,8 +79,13 @@ withWindow title wconf rconf ops = do G.gegl_exit SDL.destroyWindow window +-- | DEPRECATED! +-- Bootstrap a default window. withDefaultWindow :: Monad m => T.Text -> (RenderT m a) -> IO () withDefaultWindow title ops = withWindow title defaultWindow SDL.defaultRenderer ops -delaySec :: Int -> IO () +-- | block a thread for a specified amount of time +delaySec + :: Int -- ^ Number of seconds + -> IO () delaySec dur = SDL.delay (fromIntegral $ dur * 1000)