Store number of vertices in an intmap

This commit is contained in:
2021-08-09 00:54:19 +02:00
parent 35f2499e85
commit 3fdae85953
4 changed files with 48 additions and 125 deletions
+4 -4
View File
@@ -13,14 +13,14 @@ module Shader
import Shader.Data
import Shader.Parameters
import Shader.ExtraPrimitive
import Layers
--import Layers
--import MatrixHelper
import Foreign
import Control.Monad
import Graphics.Rendering.OpenGL hiding (Point,translate,scale,imageHeight)
import Graphics.GL.Core43
--import qualified Data.IntMap.Strict as IM
import qualified Data.IntMap.Strict as IM
--import Data.Bifunctor
--import Text.RawString.QQ
--import Linear.Matrix
@@ -60,8 +60,8 @@ bindArrayBuffersLayer numVs lay theVBO = do
where
stride = sum $ _vboAttribSizes theVBO
bindShaderLay :: PicShads VShader -> Layers (PicShads Int) -> IO ()
bindShaderLay shads = sequenceLayers_ f
bindShaderLay :: PicShads VShader -> IM.IntMap (PicShads Int) -> IO ()
bindShaderLay shads = mapM_ (uncurry f) . IM.toList
where
f lay counts = sequence_ $ bindArrayBuffersLayer' lay <$> counts <*> (_vaoVBO . _vshaderVAO <$> shads)