Work towards using mutable vectors for storing parameters

This commit is contained in:
2021-08-11 19:28:50 +02:00
parent 4bbe5d0cf1
commit b77683bafd
4 changed files with 78 additions and 28 deletions
+6 -2
View File
@@ -24,6 +24,7 @@ import Graphics.Rendering.OpenGL hiding (Line,translate,scale,imageHeight,Polygo
--import Data.Tuple.Extra
import qualified Data.IntMap.Strict as IM
import qualified SDL
import qualified Data.Vector.Unboxed.Mutable as UMV
divideSize :: Int -> Size -> Size
divideSize i (Size x y) = Size (div x $ fromIntegral i) (div y $ fromIntegral i)
@@ -148,8 +149,11 @@ pokeBindFoldable
-> IO (PicShads Int)
pokeBindFoldable pdata m = do
let shads = _pictureShaders pdata
elist <- pokeVerxs (fmap (_vaoVBO . _vshaderVAO) shads) m
bindShader shads elist
counts <- UMV.replicate 6 0
pokeVerxs (fmap (_vaoVBO . _vshaderVAO) shads) counts m
shads' <- picShadToMV shads
bindShader shads' counts
elist <- vToPicShad counts
return elist
zeroCounts :: PicShads Int