Change bufferData to bufferSubData
This commit is contained in:
+12
-6
@@ -5,23 +5,29 @@ module Shader
|
||||
, drawShaders
|
||||
, freeShaderPointers
|
||||
) where
|
||||
import Geometry.Data
|
||||
--import Geometry.Data
|
||||
import Shader.Data
|
||||
import Shader.Parameters
|
||||
import MatrixHelper
|
||||
--import MatrixHelper
|
||||
|
||||
import Foreign
|
||||
import Control.Monad
|
||||
import Graphics.Rendering.OpenGL hiding (Point,translate,scale,imageHeight)
|
||||
--import Text.RawString.QQ
|
||||
import Linear.Matrix
|
||||
import Linear.V4
|
||||
--import Linear.Matrix
|
||||
--import Linear.V4
|
||||
|
||||
bindArrayBuffers :: Int -> VBO -> IO ()
|
||||
bindArrayBuffers numVs theVBO = do
|
||||
bindBuffer ArrayBuffer $= Just (_vbo theVBO)
|
||||
bufferData ArrayBuffer $=
|
||||
(fromIntegral $ floatSize * numVs * sum (_vboAttribSizes theVBO), _vboPointer theVBO, DynamicDraw)
|
||||
-- bufferData ArrayBuffer $=
|
||||
-- (fromIntegral $ floatSize * numVs * sum (_vboAttribSizes theVBO), _vboPointer theVBO, DynamicDraw)
|
||||
bufferSubData
|
||||
ArrayBuffer
|
||||
WriteToBuffer
|
||||
0
|
||||
(fromIntegral $ floatSize * numVs * sum (_vboAttribSizes theVBO))
|
||||
(_vboPointer theVBO)
|
||||
|
||||
bindShaderBuffers :: [FullShader] -> [Int] -> IO ()
|
||||
bindShaderBuffers = zipWithM_ f
|
||||
|
||||
Reference in New Issue
Block a user