To openglraw
This commit is contained in:
@@ -15,7 +15,6 @@ import Data.List.Extra
|
||||
import Codec.Picture
|
||||
import qualified Data.Vector.Storable as VS
|
||||
import Control.Lens
|
||||
--import Graphics.Rendering.OpenGL hiding (Point,translate,scale,imageHeight)
|
||||
import Graphics.GL.Core45
|
||||
import GLHelp
|
||||
|
||||
|
||||
+7
-9
@@ -7,7 +7,6 @@ module Shader.Bind
|
||||
import Shader.Data
|
||||
import Shader.Parameters
|
||||
|
||||
import Graphics.Rendering.OpenGL hiding (Line,translate,scale,imageHeight,Polygon,Color,T)
|
||||
import Foreign hiding (rotate)
|
||||
import qualified Data.Vector.Unboxed.Mutable as UMV
|
||||
import qualified Data.Vector.Mutable as MV
|
||||
@@ -18,11 +17,8 @@ import Graphics.GL.Core45
|
||||
|
||||
bindArrayBuffers :: Int -> VBO -> IO ()
|
||||
{-# INLINABLE bindArrayBuffers #-}
|
||||
bindArrayBuffers numVs theVBO = do
|
||||
glBindBuffer GL_ARRAY_BUFFER (_vboName theVBO)
|
||||
bufferSubData
|
||||
ArrayBuffer
|
||||
WriteToBuffer
|
||||
bindArrayBuffers numVs theVBO = glNamedBufferSubData
|
||||
(_vboName theVBO)
|
||||
0
|
||||
(fromIntegral $ floatSize * numVs * sum (_vboAttribSizes theVBO))
|
||||
(_vboPtr theVBO)
|
||||
@@ -40,13 +36,15 @@ bindShaderLayers shads counts = MV.imapM_ f shads
|
||||
where
|
||||
g stride theVBO lay = do
|
||||
numVs <- UMV.unsafeRead counts $ lay * 6 + i
|
||||
bufferSubData
|
||||
ArrayBuffer
|
||||
WriteToBuffer
|
||||
glNamedBufferSubDataH
|
||||
(_vboName theVBO)
|
||||
(fromIntegral $ floatSize * stride * numSubElements * lay)
|
||||
(fromIntegral $ floatSize * numVs * stride)
|
||||
(_vboPtr theVBO `plusPtr` (floatSize * stride * numSubElements * lay))
|
||||
|
||||
glNamedBufferSubDataH :: GLuint -> GLintptr -> GLsizeiptr -> Ptr a -> IO ()
|
||||
glNamedBufferSubDataH = glNamedBufferSubData
|
||||
|
||||
bindShader :: MV.MVector (PrimState IO) FullShader -> UMV.MVector (PrimState IO) Int -> IO ()
|
||||
bindShader shads counts = MV.imapM_ f shads
|
||||
where
|
||||
|
||||
Reference in New Issue
Block a user