From 07d53ed1dedda4b87faf2c4336c06fdedfcf6182 Mon Sep 17 00:00:00 2001 From: nek0 Date: Fri, 22 Dec 2017 06:29:15 +0100 Subject: [PATCH] I'll stay in OpenGL for now --- src/Affection.hs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/Affection.hs b/src/Affection.hs index 7efabd7..d89caec 100644 --- a/src/Affection.hs +++ b/src/Affection.hs @@ -55,6 +55,32 @@ withAffection AffectionConfig{..} = do liftIO $ logIO Debug "Creating Window" window <- SDL.createWindow windowTitle windowConfig SDL.showWindow window + -- renderer <- SDL.createRenderer + -- window (-1) + -- SDL.defaultRenderer + -- { SDL.rendererTargetTexture = True + -- } + -- surface <- SDL.createRGBSurface + -- (case canvasSize of + -- Just (cw, ch) -> SDL.V2 + -- (CInt $ fromIntegral cw) + -- (CInt $ fromIntegral ch) + -- Nothing -> + -- SDL.windowInitialSize windowConfig + -- ) + -- SDL.RGBA8888 + -- texture <- SDL.createTexture + -- renderer + -- SDL.RGBA8888 + -- SDL.TextureAccessTarget + -- (case canvasSize of + -- Just (cw, ch) -> SDL.V2 + -- (CInt $ fromIntegral cw) + -- (CInt $ fromIntegral ch) + -- Nothing -> + -- SDL.windowInitialSize windowConfig + -- ) + -- SDL.rendererRenderTarget renderer $= Just texture context <- SDL.glCreateContext window let SDL.V2 (CInt rw) (CInt rh) = SDL.windowInitialSize windowConfig (w, h) = case canvasSize of @@ -115,6 +141,8 @@ withAffection AffectionConfig{..} = do ad2 <- get -- actual drawing SDL.glSwapWindow window + -- SDL.copy renderer texture Nothing Nothing + -- SDL.present renderer -- save new time ad3 <- get when (sysTime ad == sysTime ad3) (