Cleanup
This commit is contained in:
+6
-12
@@ -43,13 +43,13 @@ preloadRender = do
|
||||
let wpVBO = VBO{_vbo = wpVBOname, _vboPtr = wpVBOptr, _vboAttribSizes = [4, 4], _vboStride = 8}
|
||||
-- wpVAOname <- genObjectName
|
||||
-- bindVertexArrayObject $= Just wpVAOname
|
||||
wpVAOname <- mglCreateSingle glGenVertexArrays
|
||||
wpVAOname <- mglCreateSingle glCreateVertexArrays
|
||||
glBindVertexArray wpVAOname
|
||||
bindBuffer ArrayBuffer $= Just wpVBOname
|
||||
setupVertexAttribPointer 0 4 8 0
|
||||
--wpColVAOname <- genObjectName
|
||||
--bindVertexArrayObject $= Just wpColVAOname
|
||||
wpColVAOname <- mglCreateSingle glGenVertexArrays
|
||||
wpColVAOname <- mglCreateSingle glCreateVertexArrays
|
||||
glBindVertexArray wpColVAOname
|
||||
setupVertexAttribPointer 0 4 8 0
|
||||
setupVertexAttribPointer 1 4 8 4
|
||||
@@ -67,7 +67,7 @@ preloadRender = do
|
||||
let winVBO = VBO{_vbo = winVBOname, _vboPtr = winVBOptr, _vboAttribSizes = [4, 4], _vboStride = 8}
|
||||
--winColVAOname <- genObjectName
|
||||
--bindVertexArrayObject $= Just winColVAOname
|
||||
winColVAOname <- mglCreateSingle glGenVertexArrays
|
||||
winColVAOname <- mglCreateSingle glCreateVertexArrays
|
||||
glBindVertexArray winColVAOname
|
||||
setupVertexAttribPointer 0 4 8 0
|
||||
setupVertexAttribPointer 1 4 8 4
|
||||
@@ -99,7 +99,7 @@ preloadRender = do
|
||||
let shVBO = VBO{_vbo = shVBOname, _vboPtr = shVBOptr, _vboAttribSizes = [4, 4], _vboStride = 8}
|
||||
--shPosColVAOname <- genObjectName
|
||||
--bindVertexArrayObject $= Just shPosColVAOname
|
||||
shPosColVAOname <- mglCreateSingle glGenVertexArrays
|
||||
shPosColVAOname <- mglCreateSingle glCreateVertexArrays
|
||||
glBindVertexArray shPosColVAOname
|
||||
bindBuffer ArrayBuffer $= Just shVBOname
|
||||
setupVertexAttribPointer 0 3 7 0
|
||||
@@ -108,7 +108,7 @@ preloadRender = do
|
||||
glBindBuffer GL_ELEMENT_ARRAY_BUFFER shEBOname
|
||||
--shPosVAOname <- genObjectName
|
||||
--bindVertexArrayObject $= Just shPosVAOname
|
||||
shPosVAOname <- mglCreateSingle glGenVertexArrays
|
||||
shPosVAOname <- mglCreateSingle glCreateVertexArrays
|
||||
glBindVertexArray shPosVAOname
|
||||
bindBuffer ArrayBuffer $= Just shVBOname
|
||||
setupVertexAttribPointer 0 3 7 0
|
||||
@@ -119,12 +119,11 @@ preloadRender = do
|
||||
--setup silhouette edge VAO
|
||||
--shEdgeVAOname <- genObjectName
|
||||
--bindVertexArrayObject $= Just shEdgeVAOname
|
||||
shEdgeVAOname <- mglCreateSingle glGenVertexArrays
|
||||
shEdgeVAOname <- mglCreateSingle glCreateVertexArrays
|
||||
glBindVertexArray shEdgeVAOname
|
||||
bindBuffer ArrayBuffer $= Just shVBOname
|
||||
setupVertexAttribPointer 0 3 7 0
|
||||
--setup ebo for silhouette edges
|
||||
--silEBOname <- genObjectName
|
||||
silEBOname <- mglCreateSingle glCreateBuffers
|
||||
silEBOptr <- mallocArray numDrawableElements
|
||||
-- it may be important to bind this while the correct VAO is bound
|
||||
@@ -135,11 +134,6 @@ preloadRender = do
|
||||
( fromIntegral $ glushortSize * numDrawableElements)
|
||||
nullPtr
|
||||
GL_STREAM_DRAW
|
||||
--bufferData ElementArrayBuffer
|
||||
-- $= ( fromIntegral $ glushortSize * numDrawableElements
|
||||
-- , nullPtr
|
||||
-- , StreamDraw
|
||||
-- )
|
||||
let silEBO = EBO{_eboName = silEBOname, _eboPtr = silEBOptr}
|
||||
shEdgeVAO = VAO{_vaoName = shEdgeVAOname, _vaoVBO = shVBO}
|
||||
-- lighting shaders
|
||||
|
||||
@@ -130,7 +130,7 @@ setupVAO = setupVAOSized numDrawableElements
|
||||
|
||||
setupVAOSized :: Int -> [Int] -> IO VAO
|
||||
setupVAOSized ndraw sizes = do
|
||||
vaoname <- mglCreateSingle glGenVertexArrays
|
||||
vaoname <- mglCreateSingle glCreateVertexArrays
|
||||
glBindVertexArray vaoname
|
||||
theVBO <- setupVBOSized ndraw sizes
|
||||
return $
|
||||
|
||||
Reference in New Issue
Block a user