From 0f3c33b243e3be5a579bbf86ff97cf86c4df5d86 Mon Sep 17 00:00:00 2001 From: nek0 Date: Fri, 6 Jul 2018 17:17:12 +0200 Subject: [PATCH] don't duplicate main context --- src/Init.hs | 1 - src/Load.hs | 3 ++- src/Main.hs | 1 - src/Types/UserData.hs | 1 - 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Init.hs b/src/Init.hs index f77c108..75f772b 100644 --- a/src/Init.hs +++ b/src/Init.hs @@ -46,7 +46,6 @@ init = do , worldState = ws , stateData = None , threadContext = Nothing - , mainContext = Nothing } loadPlayerSprite diff --git a/src/Load.hs b/src/Load.hs index 3afa9e9..19ec3ee 100644 --- a/src/Load.hs +++ b/src/Load.hs @@ -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 diff --git a/src/Main.hs b/src/Main.hs index 19b1d00..6601610 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -57,7 +57,6 @@ pre = do _ <- partSubscribe w exitOnWindowClose putAffection ud { threadContext = Just threadCtx - , mainContext = Just (glContext ad) , window = Just (drawWindow ad) } diff --git a/src/Types/UserData.hs b/src/Types/UserData.hs index 9f107ae..ecb150f 100644 --- a/src/Types/UserData.hs +++ b/src/Types/UserData.hs @@ -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 }