don't duplicate main context
This commit is contained in:
parent
157158076f
commit
0f3c33b243
4 changed files with 2 additions and 4 deletions
|
@ -46,7 +46,6 @@ init = do
|
||||||
, worldState = ws
|
, worldState = ws
|
||||||
, stateData = None
|
, stateData = None
|
||||||
, threadContext = Nothing
|
, threadContext = Nothing
|
||||||
, mainContext = Nothing
|
|
||||||
}
|
}
|
||||||
|
|
||||||
loadPlayerSprite
|
loadPlayerSprite
|
||||||
|
|
|
@ -25,6 +25,7 @@ import Util
|
||||||
|
|
||||||
loadLoad :: Affection UserData ()
|
loadLoad :: Affection UserData ()
|
||||||
loadLoad = do
|
loadLoad = do
|
||||||
|
ad <- A.get
|
||||||
ud <- getAffection
|
ud <- getAffection
|
||||||
progress <- liftIO $ newMVar 0
|
progress <- liftIO $ newMVar 0
|
||||||
future <- liftIO $ newEmptyMVar
|
future <- liftIO $ newEmptyMVar
|
||||||
|
@ -38,7 +39,7 @@ loadLoad = do
|
||||||
(nano ud)
|
(nano ud)
|
||||||
future
|
future
|
||||||
progress
|
progress
|
||||||
SDL.glMakeCurrent (fromJust $ window ud) (fromJust $ mainContext ud)
|
SDL.glMakeCurrent (fromJust $ window ud) (glContext ad)
|
||||||
putAffection ud
|
putAffection ud
|
||||||
{ stateMVar = future
|
{ stateMVar = future
|
||||||
, stateProgress = progress
|
, stateProgress = progress
|
||||||
|
|
|
@ -57,7 +57,6 @@ pre = do
|
||||||
_ <- partSubscribe w exitOnWindowClose
|
_ <- partSubscribe w exitOnWindowClose
|
||||||
putAffection ud
|
putAffection ud
|
||||||
{ threadContext = Just threadCtx
|
{ threadContext = Just threadCtx
|
||||||
, mainContext = Just (glContext ad)
|
|
||||||
, window = Just (drawWindow ad)
|
, window = Just (drawWindow ad)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,6 @@ data UserData = UserData
|
||||||
, stateMVar :: MVar (SystemState Entity IO, StateData)
|
, stateMVar :: MVar (SystemState Entity IO, StateData)
|
||||||
, stateProgress :: MVar Float
|
, stateProgress :: MVar Float
|
||||||
, threadContext :: Maybe SDL.GLContext
|
, threadContext :: Maybe SDL.GLContext
|
||||||
, mainContext :: Maybe SDL.GLContext
|
|
||||||
, window :: Maybe SDL.Window
|
, window :: Maybe SDL.Window
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue