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