summaryrefslogtreecommitdiff
path: root/src/LambdaCube/GL/Input.hs
diff options
context:
space:
mode:
authorCsaba Hruska <csaba.hruska@gmail.com>2016-12-23 14:13:56 +0100
committerCsaba Hruska <csaba.hruska@gmail.com>2016-12-23 14:13:56 +0100
commit5332c0ae54eeb591762e0b348d2fcf8132988b1d (patch)
tree6dbc20251ec78e2213b6f8c50971e8f18ccc2940 /src/LambdaCube/GL/Input.hs
parent2f7f5032a8ddaa968b53476c8ae070d1d2961691 (diff)
make renderable graphics order optional
Diffstat (limited to 'src/LambdaCube/GL/Input.hs')
-rw-r--r--src/LambdaCube/GL/Input.hs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/LambdaCube/GL/Input.hs b/src/LambdaCube/GL/Input.hs
index 00b2773..c979e28 100644
--- a/src/LambdaCube/GL/Input.hs
+++ b/src/LambdaCube/GL/Input.hs
@@ -133,15 +133,14 @@ addObject input slotName prim indices attribs uniformNames = do
133 Just ic <- readIORef $ glInput p 133 Just ic <- readIORef $ glInput p
134 case icSlotMapInputToPipeline ic ! slotIdx of 134 case icSlotMapInputToPipeline ic ! slotIdx of
135 Nothing -> do 135 Nothing -> do
136 putStrLn $ " ** slot is not used!" 136 --putStrLn $ " ** slot is not used!"
137 return V.empty -- this slot is not used in that pipeline 137 return V.empty -- this slot is not used in that pipeline
138 Just pSlotIdx -> do 138 Just pSlotIdx -> do
139 putStrLn "slot is used!" 139 --putStrLn "slot is used!"
140 --where 140 --where
141 let emptyV = V.replicate (V.length $ glPrograms p) [] 141 let emptyV = V.replicate (V.length $ glPrograms p) []
142 return $ emptyV // [(prgIdx,createObjectCommands (glTexUnitMapping p) topUnis obj (glPrograms p ! prgIdx))| prgIdx <- glSlotPrograms p ! pSlotIdx] 142 return $ emptyV // [(prgIdx,createObjectCommands (glTexUnitMapping p) topUnis obj (glPrograms p ! prgIdx))| prgIdx <- glSlotPrograms p ! pSlotIdx]
143 writeIORef cmdsRef cmds 143 writeIORef cmdsRef cmds
144 sortSlotObjects input
145 return obj 144 return obj
146 145
147removeObject :: GLStorage -> Object -> IO () 146removeObject :: GLStorage -> Object -> IO ()
@@ -154,7 +153,6 @@ setObjectOrder :: GLStorage -> Object -> Int -> IO ()
154setObjectOrder p obj i = do 153setObjectOrder p obj i = do
155 writeIORef (objOrder obj) i 154 writeIORef (objOrder obj) i
156 modifyIORef (slotVector p ! objSlot obj) $ \(GLSlot objs sorted _) -> GLSlot objs sorted Reorder 155 modifyIORef (slotVector p ! objSlot obj) $ \(GLSlot objs sorted _) -> GLSlot objs sorted Reorder
157 sortSlotObjects p
158 156
159objectUniformSetter :: Object -> Map GLUniformName InputSetter 157objectUniformSetter :: Object -> Map GLUniformName InputSetter
160objectUniformSetter = objUniSetter 158objectUniformSetter = objUniSetter