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 Data.Functor ((<$>))
import Data.Monoid (mappend)
import qualified Data.HashMap.Strict as Map
-- FFI
import Foreign.Marshal.Array (pokeArray)
@ -110,6 +111,7 @@ main =
game' <- newTVarIO GameState
{ _currentMap = curMap
}
camStack' <- newTVarIO Map.empty
glHud' <- initHud
let zDistClosest' = 2
zDistFarthest' = zDistClosest' + 10
@ -138,6 +140,7 @@ main =
, _tessClockFactor = 0
}
, _camera = cam'
, _camStack = camStack'
, _mouse = MouseState
{ _isDown = False
, _isDragging = False

View File

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