From 62921052df9dd68c97fd4c48a08ea81e029ac839 Mon Sep 17 00:00:00 2001 From: nek0 Date: Sat, 16 Jun 2018 19:34:42 +0200 Subject: [PATCH] set sharable contexts --- src/Affection.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Affection.hs b/src/Affection.hs index 37cd4bd..3bbf0d9 100644 --- a/src/Affection.hs +++ b/src/Affection.hs @@ -10,6 +10,8 @@ module Affection import SDL (($=)) import qualified SDL +import qualified SDL.Raw.Video as SDL (glSetAttribute) +import qualified SDL.Raw.Enum as SDL import System.Clock @@ -83,6 +85,7 @@ withAffection AffectionConfig{..} = do -- SDL.windowInitialSize windowConfig -- ) -- SDL.rendererRenderTarget renderer $= Just texture + _ <- SDL.glSetAttribute SDL.SDL_GL_SHARE_WITH_CURRENT_CONTEXT 1 context <- SDL.glCreateContext window let SDL.V2 (CInt rw) (CInt rh) = SDL.windowInitialSize windowConfig (w, h) = case canvasSize of