Broken binding of central picture in one pass

This commit is contained in:
jgk
2021-07-26 00:53:35 +02:00
parent 4f44b748bf
commit 5dfebd221d
9 changed files with 165 additions and 17 deletions
+13 -1
View File
@@ -19,7 +19,7 @@ import Foreign hiding (rotate)
import Graphics.Rendering.OpenGL hiding (Line,translate,scale,imageHeight,Polygon,Color,T)
--import Data.Foldable
--import Data.Tuple.Extra
--import qualified Data.IntMap.Strict as IM
import qualified Data.IntMap.Strict as IM
import qualified SDL
divideSize :: Int -> Size -> Size
@@ -152,6 +152,18 @@ renderShader shad dat = do
eticks <- SDL.ticks
return $ eticks - sticks
pokeBindFoldableLayer
:: Foldable f
=> RenderData
-> f (Int,RenderType)
-> IO (IM.IntMap [(FullShader,Int)])
pokeBindFoldableLayer pdata m = do
let slist = (,) <$> [0..6] <*> _pictureShaders pdata
is <- F.foldM (traverse pokeShaderLayer slist) m
bindShaderLayer slist is
return $ IM.fromListWith (++) $ zipWith (\(i,fs) n -> (i,[(fs,n)])) slist is
renderFoldable
:: Foldable f
=> RenderData