updating examples

This commit is contained in:
nek0 2016-12-12 02:10:30 +01:00
parent 663ffca664
commit b0d44124dc
3 changed files with 18 additions and 19 deletions

View file

@ -26,6 +26,7 @@ main = do
{ initComponents = All { initComponents = All
, windowTitle = "Affection: example00" , windowTitle = "Affection: example00"
, windowConfig = SDL.defaultWindow , windowConfig = SDL.defaultWindow
, preLoop = return ()
, drawLoop = draw , drawLoop = draw
, updateLoop = update , updateLoop = update
, loadState = load , loadState = load

View file

@ -26,6 +26,7 @@ main = do
{ initComponents = All { initComponents = All
, windowTitle = "Affection: example00" , windowTitle = "Affection: example00"
, windowConfig = SDL.defaultWindow , windowConfig = SDL.defaultWindow
, preLoop = return ()
, drawLoop = draw , drawLoop = draw
, updateLoop = update , updateLoop = update
, loadState = load , loadState = load

View file

@ -1,6 +1,8 @@
{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE RecordWildCards #-}
module Affection module Affection
( withAffection ( withAffection
, getAffection
, putAffection
-- , withWindow -- , withWindow
-- , withDefaultWindow -- , withDefaultWindow
, delaySec , delaySec
@ -91,25 +93,20 @@ withAffection AffectionConfig{..} = do
cleanUp $ userState nState cleanUp $ userState nState
SDL.quit SDL.quit
-- -- | DEPRECATED! -- | Return the userstate to the user
-- -- Function for bootstraping a window. getAffection :: Affection us us
-- withWindow :: Monad m => T.Text -> WindowConfig -> SDL.RendererConfig -> RenderT m a -> IO () getAffection = do
-- withWindow title wconf rconf ops = do ad <- get
-- window <- SDL.createWindow title wconf return $ userState ad
-- -- I don't need a renderer here, i need a surface
-- renderer <- SDL.createRenderer window (-1) rconf -- | Put altered user state back
-- surface <- SDL.getWindowSurface window putAffection
-- G.gegl_init :: us -- User state
-- -- I think I need some AffectionT or someting similar here and not a RenderT -> Affection us ()
-- -- from SDL. putAffection us = do
-- inRender renderer $ ops ad <- get
-- G.gegl_exit put $ ad
-- SDL.destroyWindow window { userState = us }
--
-- -- | DEPRECATED!
-- -- Bootstrap a default window.
-- withDefaultWindow :: Monad m => T.Text -> (RenderT m a) -> IO ()
-- withDefaultWindow title ops = withWindow title defaultWindow SDL.defaultRenderer ops
-- | block a thread for a specified amount of time -- | block a thread for a specified amount of time
delaySec delaySec