Created basic graphical engine
This commit is contained in:
parent
33ff8cd8a9
commit
d8c1579147
17
Graphics/Engine.hs
Normal file
17
Graphics/Engine.hs
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
module Graphics.Engine where
|
||||||
|
|
||||||
|
import Control.Arrow
|
||||||
|
import Control.Monad.Representable.Reader
|
||||||
|
import FRP.Yampa
|
||||||
|
import GOL.Engine
|
||||||
|
import GOL.Space
|
||||||
|
import Graphics.GlossUtils (InputEvent)
|
||||||
|
|
||||||
|
tickEvent :: SF a (Event ())
|
||||||
|
tickEvent = repeatedly 1.0 ()
|
||||||
|
|
||||||
|
initialSpace :: Space f => f Bool
|
||||||
|
initialSpace = tabulate $ const False
|
||||||
|
|
||||||
|
engine :: Space f => GOL f Bool -> SF a (GOL f Bool)
|
||||||
|
engine start = tickEvent >>> accumHoldBy (\s _ -> tick s) start
|
Loading…
Reference in a new issue