I'll stay in OpenGL for now

This commit is contained in:
nek0 2017-12-22 06:29:15 +01:00
parent 09f9ac07ae
commit 07d53ed1de
1 changed files with 28 additions and 0 deletions

View File

@ -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) (