don't duplicate main context

This commit is contained in:
nek0 2018-07-06 17:17:12 +02:00
parent 157158076f
commit 0f3c33b243
4 changed files with 2 additions and 4 deletions

View file

@ -46,7 +46,6 @@ init = do
, worldState = ws
, stateData = None
, threadContext = Nothing
, mainContext = Nothing
}
loadPlayerSprite

View file

@ -25,6 +25,7 @@ import Util
loadLoad :: Affection UserData ()
loadLoad = do
ad <- A.get
ud <- getAffection
progress <- liftIO $ newMVar 0
future <- liftIO $ newEmptyMVar
@ -38,7 +39,7 @@ loadLoad = do
(nano ud)
future
progress
SDL.glMakeCurrent (fromJust $ window ud) (fromJust $ mainContext ud)
SDL.glMakeCurrent (fromJust $ window ud) (glContext ad)
putAffection ud
{ stateMVar = future
, stateProgress = progress

View file

@ -57,7 +57,6 @@ pre = do
_ <- partSubscribe w exitOnWindowClose
putAffection ud
{ threadContext = Just threadCtx
, mainContext = Just (glContext ad)
, window = Just (drawWindow ad)
}

View file

@ -37,7 +37,6 @@ data UserData = UserData
, stateMVar :: MVar (SystemState Entity IO, StateData)
, stateProgress :: MVar Float
, threadContext :: Maybe SDL.GLContext
, mainContext :: Maybe SDL.GLContext
, window :: Maybe SDL.Window
}