To openglraw

This commit is contained in:
2023-03-09 21:28:22 +00:00
parent 653de7226e
commit 9989c65d75
5 changed files with 11 additions and 16 deletions
+5 -5
View File
@@ -19,7 +19,7 @@ import Control.Concurrent
import Control.Exception
import Control.Monad
import qualified Data.Text as T
import qualified Graphics.Rendering.OpenGL as GL
import Graphics.GL.Core45
import SDL
import System.Mem
import Data.Foldable
@@ -47,7 +47,7 @@ setupLoop spf title winconfig paramCleanup ioStartWorld sideEffects eventFn = do
destroyWindow
$ \window -> bracket
(glCreateContext window)
(\con -> GL.finish >> glDeleteContext con)
(\con -> glFinish >> glDeleteContext con)
$ \_ ->
bracket
ioStartWorld
@@ -89,7 +89,7 @@ applyEventIO fn mw e = case eventPayload e of
QuitEvent -> return Nothing
WindowClosedEvent _ -> return Nothing
WindowSizeChangedEvent WindowSizeChangedEventData{windowSizeChangedEventSize = V2 x y} ->
(GL.viewport $= (GL.Position 0 0, GL.Size x y)) >> mupdate
glViewport 0 0 x y >> mupdate
_ -> mupdate
where
mupdate = case mw of
@@ -123,7 +123,7 @@ setupConLoop spf title winconfig paramCleanup ioStartWorld coneffs sideEffects e
destroyWindow
$ \window -> bracket
(glCreateContext window)
(\con -> GL.finish >> glDeleteContext con)
(\con -> glFinish >> glDeleteContext con)
$ \_ ->
bracket
ioStartWorld
@@ -213,7 +213,7 @@ setupConLoop' spf title winconfig paramCleanup ioStartWorld coneffs sideEffects
destroyWindow
$ \window -> bracket
(glCreateContext window)
(\con -> GL.finish >> glDeleteContext con)
(\con -> glFinish >> glDeleteContext con)
$ \_ ->
bracket
ioStartWorld