Refactor EBO to use DSA
This commit is contained in:
+19
-9
@@ -19,7 +19,7 @@ import Dodge.Render.ShapePicture
|
||||
import Dodge.Render.Walls
|
||||
import Foreign
|
||||
import Geometry
|
||||
import Graphics.GL.Core43
|
||||
import Graphics.GL.Core45
|
||||
import Graphics.Rendering.OpenGL hiding (color, rotate, scale, translate)
|
||||
import MatrixHelper
|
||||
import Render
|
||||
@@ -84,17 +84,27 @@ doDrawing win pdata u = do
|
||||
, (_windowShader pdata, nWins)
|
||||
, (_textureArrayShader pdata, nFls)
|
||||
]
|
||||
bindBuffer ElementArrayBuffer $= pdata ^? shapeEBO . ebo --Just (_ebo $ _shapeEBO pdata)
|
||||
bufferSubData
|
||||
ElementArrayBuffer
|
||||
WriteToBuffer
|
||||
--bindBuffer ElementArrayBuffer $= pdata ^? shapeEBO . eboName --Just (_ebo $ _shapeEBO pdata)
|
||||
--bufferSubData
|
||||
-- ElementArrayBuffer
|
||||
-- WriteToBuffer
|
||||
-- 0
|
||||
-- (fromIntegral $ glushortSize * nIndices)
|
||||
-- (_eboPtr $ _shapeEBO pdata)
|
||||
glNamedBufferSubData
|
||||
(_eboName $ _shapeEBO pdata)
|
||||
0
|
||||
(fromIntegral $ glushortSize * nIndices)
|
||||
(_eboPtr $ _shapeEBO pdata)
|
||||
bindBuffer ElementArrayBuffer $= pdata ^? silhouetteEBO . ebo --Just (_ebo $ _silhouetteEBO pdata)
|
||||
bufferSubData
|
||||
ElementArrayBuffer
|
||||
WriteToBuffer
|
||||
--bindBuffer ElementArrayBuffer $= pdata ^? silhouetteEBO . eboName --Just (_ebo $ _silhouetteEBO pdata)
|
||||
--bufferSubData
|
||||
-- ElementArrayBuffer
|
||||
-- WriteToBuffer
|
||||
-- 0
|
||||
-- (fromIntegral $ glushortSize * nSilIndices)
|
||||
-- (_eboPtr $ _silhouetteEBO pdata)
|
||||
glNamedBufferSubData
|
||||
(_eboName $ _silhouetteEBO pdata)
|
||||
0
|
||||
(fromIntegral $ glushortSize * nSilIndices)
|
||||
(_eboPtr $ _silhouetteEBO pdata)
|
||||
|
||||
@@ -33,7 +33,7 @@ drawCPUShadows pdata s pos rad = do
|
||||
--currentProgram $= theshad ^? shadProg
|
||||
glUseProgram (theshad ^. shadProg')
|
||||
--bindVertexArrayObject $= Just (_vaoName $ _shadVAO' theshad)
|
||||
glBindVertexArray $ (_vaoName $ _shadVAO' theshad)
|
||||
glBindVertexArray . _vaoName $ _shadVAO' theshad
|
||||
glDrawArrays
|
||||
(marshalEPrimitiveMode $ _shadPrim' theshad)
|
||||
0
|
||||
|
||||
Reference in New Issue
Block a user