squeaky clean graphics now

This commit is contained in:
nek0 2020-02-06 05:46:37 +01:00
parent ba956ea3d6
commit 69a951fd28
4 changed files with 14 additions and 10 deletions

View file

@ -44,7 +44,7 @@ load = do
GL.bindBuffer GL.ArrayBuffer $= Just verts GL.bindBuffer GL.ArrayBuffer $= Just verts
withArray (loTriangles lobj) $ \ptr -> withArray (loTriangles lobj) $ \ptr ->
GL.bufferData GL.ArrayBuffer $= GL.bufferData GL.ArrayBuffer $=
( fromIntegral $ length (loTriangles lobj) * 3 * sizeOf (0 :: Double) ( fromIntegral $ length (loTriangles lobj) {-* 3-} * sizeOf (0 :: Double)
, ptr , ptr
, GL.StaticDraw , GL.StaticDraw
) )

View file

@ -42,7 +42,7 @@ load = do
GL.bindBuffer GL.ArrayBuffer $= Just verts GL.bindBuffer GL.ArrayBuffer $= Just verts
withArray (loTriangles lobj) $ \ptr -> withArray (loTriangles lobj) $ \ptr ->
GL.bufferData GL.ArrayBuffer $= GL.bufferData GL.ArrayBuffer $=
( fromIntegral $ length (loTriangles lobj) * 3 * sizeOf (0 :: Double) ( fromIntegral $ length (loTriangles lobj) {-* 3-} * sizeOf (0 :: Double)
, ptr , ptr
, GL.StaticDraw , GL.StaticDraw
) )

View file

@ -173,7 +173,7 @@ genVertBufObject path = do
GL.bindBuffer GL.ArrayBuffer $= Just vbo GL.bindBuffer GL.ArrayBuffer $= Just vbo
withArray (loTriangles lobj) $ \ptr -> withArray (loTriangles lobj) $ \ptr ->
GL.bufferData GL.ArrayBuffer $= GL.bufferData GL.ArrayBuffer $=
( fromIntegral $ length (loTriangles lobj) * 3 * sizeOf (0 :: Double) ( fromIntegral $ length (loTriangles lobj) {-* 3-} * sizeOf (0 :: Double)
, ptr , ptr
, GL.StaticDraw , GL.StaticDraw
) )

View file

@ -60,14 +60,18 @@ main = do
withAffection AffectionConfig withAffection AffectionConfig
{ initComponents = All { initComponents = All
, windowTitle = "hw" , windowTitle = "hw"
, windowConfig = SDL.defaultWindow , windowConfigs = [
{ SDL.windowInitialSize = SDL.V2 ( 0
(CInt $ fromIntegral $ width o) , SDL.defaultWindow
(CInt $ fromIntegral $ height o) { SDL.windowInitialSize = SDL.V2
, SDL.windowOpenGL = Just SDL.defaultOpenGL (CInt $ fromIntegral $ width o)
{ SDL.glProfile = SDL.Core SDL.Normal 3 2 (CInt $ fromIntegral $ height o)
, SDL.windowGraphicsContext = SDL.OpenGLContext SDL.defaultOpenGL
{ SDL.glProfile = SDL.Core SDL.Normal 3 2
}
} }
} )
]
, initScreenMode = SDL.Fullscreen , initScreenMode = SDL.Fullscreen
, preLoop = return () , preLoop = return ()
, eventLoop = mapM_ handle , eventLoop = mapM_ handle