Various tweaks

This commit is contained in:
jgk
2021-08-18 20:38:55 +02:00
parent 61adae1e40
commit b9f73d255f
8 changed files with 35 additions and 43 deletions
+2 -1
View File
@@ -11,6 +11,7 @@ import Graphics.Rendering.OpenGL hiding (Line,translate,scale,imageHeight,Polygo
import Foreign hiding (rotate)
import qualified Data.Vector.Unboxed.Mutable as UMV
import qualified Data.Vector.Mutable as MV
import qualified Data.Vector.Fusion.Stream.Monadic as VS
import Control.Monad.Primitive
import Control.Monad
@@ -31,7 +32,7 @@ bindShaderLayers shads counts = MV.imapM_ f shads
let theVBO = _vaoVBO $ _shaderVAO shad
stride = sum $ _vboAttribSizes theVBO
bindBuffer ArrayBuffer $= (Just . _vbo $ theVBO)
mapM_ (g stride theVBO) [0..5]
VS.mapM_ (g stride theVBO) $ VS.enumFromStepN 0 1 6 -- [0..5]
where
g stride theVBO lay = do
numVs <- UMV.unsafeRead counts $ lay * 6 + i