Commit AFTER playing around with poking/vector sizing a little

This commit is contained in:
2024-10-01 12:32:23 +01:00
parent 8348c1234c
commit 6438da0037
12 changed files with 301 additions and 1889 deletions
+5 -4
View File
@@ -92,11 +92,12 @@ makeShaderUsingVBO s shaderlist sizes pm vbo = do
setupVBO :: Int -> IO VBO
setupVBO vertexsize = do
vboname <- mglCreate glCreateBuffers
thePtr <- mallocBytes (vertexsize * numDrawableElements)
thePtr <- mallocBytes (vertexsize * numDrawableVertices)
-- Allocate space
glNamedBufferData
vboname
(fromIntegral $ numDrawableElements * vertexsize)
(fromIntegral $ floatSize * numDrawableVertices * vertexsize)
-- (fromIntegral $ numDrawableVertices * vertexsize)
nullPtr
GL_STREAM_DRAW
return VBO{_vboName = vboname, _vboPtr = thePtr, _vboVertexBytes = vertexsize}
@@ -125,11 +126,11 @@ setupStaticVBOVAO vas vdata = withArrayLen vdata $ \i ptr -> do
setupVBOStatic :: Int -> IO VBO
setupVBOStatic vertexsize = do
vboname <- mglCreate glCreateBuffers
thePtr <- mallocArray (vertexsize * numDrawableElements)
thePtr <- mallocArray (vertexsize * numDrawableVertices)
-- Allocate space
glNamedBufferData
vboname
(fromIntegral $ floatSize * numDrawableElements * vertexsize)
(fromIntegral $ floatSize * numDrawableVertices * vertexsize)
nullPtr
GL_STATIC_DRAW
return VBO{_vboName = vboname, _vboPtr = thePtr, _vboVertexBytes = floatSize * vertexsize}