Translate VAOs to DSA
This commit is contained in:
+26
-12
@@ -5,6 +5,7 @@ module Preload.Render (
|
||||
cleanUpRenderPreload,
|
||||
) where
|
||||
|
||||
import GLHelp
|
||||
import Control.Lens
|
||||
import Control.Monad
|
||||
import Data.Preload.Render
|
||||
@@ -18,6 +19,7 @@ import Shader.Bind
|
||||
import Shader.Compile
|
||||
import Shader.Data
|
||||
import Shader.Parameters
|
||||
import Graphics.GL.Core45
|
||||
|
||||
numDrawableWalls :: Int
|
||||
numDrawableWalls = 5000
|
||||
@@ -39,12 +41,16 @@ preloadRender = do
|
||||
, StreamDraw
|
||||
)
|
||||
let wpVBO = VBO{_vbo = wpVBOname, _vboPtr = wpVBOptr, _vboAttribSizes = [4, 4], _vboStride = 8}
|
||||
wpVAOname <- genObjectName
|
||||
bindVertexArrayObject $= Just wpVAOname
|
||||
-- wpVAOname <- genObjectName
|
||||
-- bindVertexArrayObject $= Just wpVAOname
|
||||
wpVAOname <- mglCreateSingle glGenVertexArrays
|
||||
glBindVertexArray wpVAOname
|
||||
bindBuffer ArrayBuffer $= Just wpVBOname
|
||||
setupVertexAttribPointer 0 4 8 0
|
||||
wpColVAOname <- genObjectName
|
||||
bindVertexArrayObject $= Just wpColVAOname
|
||||
--wpColVAOname <- genObjectName
|
||||
--bindVertexArrayObject $= Just wpColVAOname
|
||||
wpColVAOname <- mglCreateSingle glGenVertexArrays
|
||||
glBindVertexArray wpColVAOname
|
||||
setupVertexAttribPointer 0 4 8 0
|
||||
setupVertexAttribPointer 1 4 8 4
|
||||
let wpVAO = VAO{_vaoName = wpVAOname, _vaoVBO = wpVBO}
|
||||
@@ -59,8 +65,10 @@ preloadRender = do
|
||||
, StreamDraw
|
||||
)
|
||||
let winVBO = VBO{_vbo = winVBOname, _vboPtr = winVBOptr, _vboAttribSizes = [4, 4], _vboStride = 8}
|
||||
winColVAOname <- genObjectName
|
||||
bindVertexArrayObject $= Just winColVAOname
|
||||
--winColVAOname <- genObjectName
|
||||
--bindVertexArrayObject $= Just winColVAOname
|
||||
winColVAOname <- mglCreateSingle glGenVertexArrays
|
||||
glBindVertexArray winColVAOname
|
||||
setupVertexAttribPointer 0 4 8 0
|
||||
setupVertexAttribPointer 1 4 8 4
|
||||
let winColVAO = VAO{_vaoName = winColVAOname, _vaoVBO = winVBO}
|
||||
@@ -83,22 +91,28 @@ preloadRender = do
|
||||
, StreamDraw
|
||||
)
|
||||
let shVBO = VBO{_vbo = shVBOname, _vboPtr = shVBOptr, _vboAttribSizes = [4, 4], _vboStride = 8}
|
||||
shPosColVAOname <- genObjectName
|
||||
bindVertexArrayObject $= Just shPosColVAOname
|
||||
--shPosColVAOname <- genObjectName
|
||||
--bindVertexArrayObject $= Just shPosColVAOname
|
||||
shPosColVAOname <- mglCreateSingle glGenVertexArrays
|
||||
glBindVertexArray shPosColVAOname
|
||||
bindBuffer ArrayBuffer $= Just shVBOname
|
||||
setupVertexAttribPointer 0 3 7 0
|
||||
setupVertexAttribPointer 1 4 7 3
|
||||
bindBuffer ElementArrayBuffer $= Just shEBOname
|
||||
shPosVAOname <- genObjectName
|
||||
bindVertexArrayObject $= Just shPosVAOname
|
||||
--shPosVAOname <- genObjectName
|
||||
--bindVertexArrayObject $= Just shPosVAOname
|
||||
shPosVAOname <- mglCreateSingle glGenVertexArrays
|
||||
glBindVertexArray shPosVAOname
|
||||
bindBuffer ArrayBuffer $= Just shVBOname
|
||||
setupVertexAttribPointer 0 3 7 0
|
||||
bindBuffer ElementArrayBuffer $= Just shEBOname
|
||||
let shPosColVAO = VAO{_vaoName = shPosColVAOname, _vaoVBO = shVBO}
|
||||
shPosVAO = VAO{_vaoName = shPosVAOname, _vaoVBO = shVBO}
|
||||
--setup silhouette edge VAO
|
||||
shEdgeVAOname <- genObjectName
|
||||
bindVertexArrayObject $= Just shEdgeVAOname
|
||||
--shEdgeVAOname <- genObjectName
|
||||
--bindVertexArrayObject $= Just shEdgeVAOname
|
||||
shEdgeVAOname <- mglCreateSingle glGenVertexArrays
|
||||
glBindVertexArray shEdgeVAOname
|
||||
bindBuffer ArrayBuffer $= Just shVBOname
|
||||
setupVertexAttribPointer 0 3 7 0
|
||||
--setup ebo for silhouette edges
|
||||
|
||||
Reference in New Issue
Block a user