Browse Source

squeaky clean graphics now

master
nek0 2 years ago
parent
commit
69a951fd28
  1. 2
      examples/example00/Init.hs
  2. 2
      examples/example01/Init.hs
  3. 2
      examples/example03/Init.hs
  4. 18
      examples/example03/Main.hs

2
examples/example00/Init.hs

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

2
examples/example01/Init.hs

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

2
examples/example03/Init.hs

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

18
examples/example03/Main.hs

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

Loading…
Cancel
Save