live-Coding

This commit is contained in:
Nicole Dresselhaus 2014-05-30 15:26:12 +02:00
parent 91ad0f5e38
commit b3323ef054
No known key found for this signature in database
GPG Key ID: BC16D887851A1A80
2 changed files with 5 additions and 0 deletions

View File

@ -18,6 +18,7 @@ import Control.Concurrent.STM.TVar (newTVarIO, writeTVar, rea
import Control.Monad.RWS.Strict (ask, evalRWST, get, liftIO, modify) import Control.Monad.RWS.Strict (ask, evalRWST, get, liftIO, modify)
import Data.Functor ((<$>)) import Data.Functor ((<$>))
import Data.Monoid (mappend) import Data.Monoid (mappend)
import qualified Data.HashMap.Strict as Map
-- FFI -- FFI
import Foreign.Marshal.Array (pokeArray) import Foreign.Marshal.Array (pokeArray)
@ -110,6 +111,7 @@ main =
game' <- newTVarIO GameState game' <- newTVarIO GameState
{ _currentMap = curMap { _currentMap = curMap
} }
camStack' <- newTVarIO Map.empty
glHud' <- initHud glHud' <- initHud
let zDistClosest' = 2 let zDistClosest' = 2
zDistFarthest' = zDistClosest' + 10 zDistFarthest' = zDistClosest' + 10
@ -138,6 +140,7 @@ main =
, _tessClockFactor = 0 , _tessClockFactor = 0
} }
, _camera = cam' , _camera = cam'
, _camStack = camStack'
, _mouse = MouseState , _mouse = MouseState
{ _isDown = False { _isDown = False
, _isDragging = False , _isDragging = False

View File

@ -180,6 +180,7 @@ data UIState = UIState
data State = State data State = State
{ _window :: !WindowState { _window :: !WindowState
, _camera :: TVar CameraState , _camera :: TVar CameraState
, _camStack :: TVar (Map.HashMap UIId (CameraState, TextureObject))
, _io :: !IOState , _io :: !IOState
, _mouse :: !MouseState , _mouse :: !MouseState
, _keyboard :: !KeyboardState , _keyboard :: !KeyboardState
@ -188,6 +189,7 @@ data State = State
, _ui :: !UIState , _ui :: !UIState
} }
type Pioneers = RWST Env () State IO type Pioneers = RWST Env () State IO
-- when using TemplateHaskell order of declaration matters -- when using TemplateHaskell order of declaration matters