summaryrefslogtreecommitdiff
path: root/src/LambdaCube/GL/Backend.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/Backend.hs
parent2f7f5032a8ddaa968b53476c8ae070d1d2961691 (diff)
make renderable graphics order optional
Diffstat (limited to 'src/LambdaCube/GL/Backend.hs')
-rw-r--r--src/LambdaCube/GL/Backend.hs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/LambdaCube/GL/Backend.hs b/src/LambdaCube/GL/Backend.hs
index 37b38c0..c682723 100644
--- a/src/LambdaCube/GL/Backend.hs
+++ b/src/LambdaCube/GL/Backend.hs
@@ -750,14 +750,16 @@ renderFrame glp = do
750 case input of 750 case input of
751 Nothing -> putStrLn "Warning: No pipeline input!" >> return () 751 Nothing -> putStrLn "Warning: No pipeline input!" >> return ()
752 Just ic -> do 752 Just ic -> do
753 GLSlot _ objs _ <- readIORef (slotVector (icInput ic) ! (icSlotMapPipelineToInput ic ! slotIdx)) 753 let draw obj = do
754 --putStrLn $ "Rendering " ++ show (V.length objs) ++ " objects" 754 enabled <- readIORef $ objEnabled obj
755 V.forM_ objs $ \(_,obj) -> do 755 when enabled $ do
756 enabled <- readIORef $ objEnabled obj
757 when enabled $ do
758 cmd <- readIORef $ objCommands obj 756 cmd <- readIORef $ objCommands obj
759 --putStrLn "Render object" 757 --putStrLn "Render object"
760 renderSlot ((cmd ! icId ic) ! progIdx) 758 renderSlot ((cmd ! icId ic) ! progIdx)
759 --putStrLn $ "Rendering " ++ show (V.length objs) ++ " objects"
760 readIORef (slotVector (icInput ic) ! (icSlotMapPipelineToInput ic ! slotIdx)) >>= \case
761 GLSlot _ objs Ordered -> forM_ objs $ draw . snd
762 GLSlot objMap _ _ -> forM_ objMap draw
761 {- 763 {-
762 GLSetSampler 764 GLSetSampler
763 GLSaveImage 765 GLSaveImage