Commit AFTER playing around with poking/vector sizing a little
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user