Translate VAOs to DSA
This commit is contained in:
+11
-6
@@ -8,6 +8,7 @@ module Shader.Compile (
|
||||
setupVertexAttribPointer,
|
||||
) where
|
||||
|
||||
import GLHelp
|
||||
import Control.Monad
|
||||
import qualified Data.ByteString as BS
|
||||
import qualified Data.ByteString.Unsafe as BU
|
||||
@@ -129,23 +130,27 @@ shaderTypeExt' _ = undefined
|
||||
-- I think that this requires that the correct shader program is bound?
|
||||
setupVAO :: [Int] -> IO VAO
|
||||
setupVAO sizes = do
|
||||
theVAO <- genObjectName
|
||||
bindVertexArrayObject $= Just theVAO
|
||||
--theVAO <- genObjectName
|
||||
--bindVertexArrayObject $= Just theVAO
|
||||
vaoname <- mglCreateSingle glGenVertexArrays
|
||||
glBindVertexArray vaoname
|
||||
theVBO <- setupVBO sizes
|
||||
return $
|
||||
VAO
|
||||
{ _vaoName = theVAO
|
||||
{ _vaoName = vaoname
|
||||
, _vaoVBO = theVBO
|
||||
}
|
||||
|
||||
setupVAOSized :: [Int] -> Int -> IO VAO
|
||||
setupVAOSized sizes ndraw = do
|
||||
theVAO <- genObjectName
|
||||
bindVertexArrayObject $= Just theVAO
|
||||
vaoname <- mglCreateSingle glGenVertexArrays
|
||||
glBindVertexArray vaoname
|
||||
-- theVAO <- genObjectName
|
||||
--bindVertexArrayObject $= Just theVAO
|
||||
theVBO <- setupVBOSized sizes ndraw
|
||||
return $
|
||||
VAO
|
||||
{ _vaoName = theVAO
|
||||
{ _vaoName = vaoname
|
||||
, _vaoVBO = theVBO
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user