Implement poking using Verx lists

This commit is contained in:
2021-07-30 20:04:55 +02:00
parent 834464db51
commit d7649b951b
12 changed files with 109 additions and 155 deletions
+5 -4
View File
@@ -13,13 +13,14 @@ module Shader
import Shader.Data
import Shader.Parameters
import Shader.ExtraPrimitive
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
@@ -59,10 +60,10 @@ bindArrayBuffersLayer numVs lay theVBO = do
where
stride = sum $ _vboAttribSizes theVBO
bindShaderLay :: PicShads VShader -> IM.IntMap (PicShads Int) -> IO ()
bindShaderLay shads = mapM_ f . IM.toList
bindShaderLay :: PicShads VShader -> Layers (PicShads Int) -> IO ()
bindShaderLay shads = sequenceLayers_ f
where
f (lay,counts) = sequence_ $ bindArrayBuffersLayer' lay <$> counts <*> (_vaoVBO . _vshaderVAO <$> shads)
f lay counts = sequence_ $ bindArrayBuffersLayer' lay <$> counts <*> (_vaoVBO . _vshaderVAO <$> shads)
bindShader :: PicShads VShader -> PicShads Int -> IO ()
bindShader shads counts = sequence_ $ bindArrayBuffers <$> counts <*> (_vaoVBO . _vshaderVAO <$> shads)