I'll stay in OpenGL for now
This commit is contained in:
parent
09f9ac07ae
commit
07d53ed1de
1 changed files with 28 additions and 0 deletions
|
@ -55,6 +55,32 @@ withAffection AffectionConfig{..} = do
|
||||||
liftIO $ logIO Debug "Creating Window"
|
liftIO $ logIO Debug "Creating Window"
|
||||||
window <- SDL.createWindow windowTitle windowConfig
|
window <- SDL.createWindow windowTitle windowConfig
|
||||||
SDL.showWindow window
|
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
|
context <- SDL.glCreateContext window
|
||||||
let SDL.V2 (CInt rw) (CInt rh) = SDL.windowInitialSize windowConfig
|
let SDL.V2 (CInt rw) (CInt rh) = SDL.windowInitialSize windowConfig
|
||||||
(w, h) = case canvasSize of
|
(w, h) = case canvasSize of
|
||||||
|
@ -115,6 +141,8 @@ withAffection AffectionConfig{..} = do
|
||||||
ad2 <- get
|
ad2 <- get
|
||||||
-- actual drawing
|
-- actual drawing
|
||||||
SDL.glSwapWindow window
|
SDL.glSwapWindow window
|
||||||
|
-- SDL.copy renderer texture Nothing Nothing
|
||||||
|
-- SDL.present renderer
|
||||||
-- save new time
|
-- save new time
|
||||||
ad3 <- get
|
ad3 <- get
|
||||||
when (sysTime ad == sysTime ad3) (
|
when (sysTime ad == sysTime ad3) (
|
||||||
|
|
Loading…
Reference in a new issue