Store picture shaders in mutable vector

This commit is contained in:
jgk
2021-08-12 06:29:36 +02:00
parent 0138f7b940
commit 62af1402ad
4 changed files with 19 additions and 13 deletions
+13 -9
View File
@@ -15,8 +15,9 @@ import Data.Preload.Render
import Graphics.Rendering.OpenGL hiding (Point,translate,scale,imageHeight)
import Graphics.GL.Core43
--import Control.Lens
--import Control.Monad
import Control.Monad
import Foreign
import qualified Data.Vector.Mutable as MV
numDrawableWalls :: Int
numDrawableWalls = 5000
@@ -116,15 +117,18 @@ preloadRender = do
-- set the clearColor to have 1 alpha
clearColor $= Color4 0 0 0 1
shadV <- MV.new 6
zipWithM_ (MV.write shadV) [0..5]
[ bslist -- note the ordering is very important
, basicTweakZShad -- ShadNum
, bezierQuadShader
, cslist
, aslist
, eslist
]
return $ RenderData
{ _pictureShaders = PicShads
{ _psPoly = bslist
, _psText = cslist
, _psArc = aslist
, _psEll = eslist
, _psBez = bezierQuadShader
, _psPolyz = basicTweakZShad
}
{ _pictureShaders = shadV
, _lightingSurfaceShader = lightingSurfaceShad
, _lightingLineShadowShader = lightingLineShadowShad
, _lightingOccludeShader = wsShad {_shaderVAO = wpVAO}