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
withArray (loTriangles lobj) $ \ptr ->
GL.bufferData GL.ArrayBuffer $=
( fromIntegral $ length (loTriangles lobj) * 3 * sizeOf (0 :: Double)
( fromIntegral $ length (loTriangles lobj) {-* 3-} * sizeOf (0 :: Double)
, ptr
, GL.StaticDraw
)

View file

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

View file

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

View file

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