use OpenGL's internal datatypes

This commit is contained in:
nek0 2020-05-17 13:04:13 +02:00
parent 4715d3f8e0
commit 38a7c098dd
1 changed files with 4 additions and 4 deletions

View File

@ -73,10 +73,10 @@ main = do
, 0.5 , (-0.5) -- 1
, 0.5 , 0.5 -- 2
, (-0.5), 0.5 -- 3
] :: [Float]
] :: [GL.GLfloat]
-- create draw order indices
indices = [0, 1, 2, 2, 3, 0] :: [Word]
indices = [0, 1, 2, 2, 3, 0] :: [GL.GLuint]
-- create and bind buffer for vertices
buf <- GL.genObjectName
@ -88,7 +88,7 @@ main = do
-- Feed the data to the buffer
GL.bufferData GL.ArrayBuffer $=
-- how much bytes of memory we are going to write (as an Int32)
( fromIntegral $ length vertexPositions * sizeOf (undefined :: Float)
( fromIntegral $ length vertexPositions * sizeOf (undefined :: GL.GLfloat)
-- The pointer to the data
, ptr
-- The data's usage
@ -120,7 +120,7 @@ main = do
-- Feed the data to the buffer
GL.bufferData GL.ElementArrayBuffer $=
-- how much bytes of memory we are going to write (as an Int32)
( fromIntegral $ length indices * sizeOf (undefined :: Word)
( fromIntegral $ length indices * sizeOf (undefined :: GL.GLuint)
-- The pointer to the data
, ptr
-- The data's usage