summaryrefslogtreecommitdiff
path: root/GPURing.hs
diff options
context:
space:
mode:
Diffstat (limited to 'GPURing.hs')
-rw-r--r--GPURing.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/GPURing.hs b/GPURing.hs
index 3002c9e..904c551 100644
--- a/GPURing.hs
+++ b/GPURing.hs
@@ -25,15 +25,15 @@ import LambdaCube.GL.Input hiding (createObjectCommands)
25-- > ringBuffer <- newRing capacity (VectorRing.new capacity) 25-- > ringBuffer <- newRing capacity (VectorRing.new capacity)
26type Update keys = (keys -> Writer [DSum AttributeKey GLUniformValue] ()) 26type Update keys = (keys -> Writer [DSum AttributeKey GLUniformValue] ())
27 27
28new :: Data keys => String -> GLStorage -> (String -> String) -> Int -> IO (TargetBuffer (Update keys)) 28new :: Data keys => Primitive -> String -> GLStorage -> (String -> String) -> Int -> IO (TargetBuffer (Update keys))
29new streamName storage toAttr sz = fix $ \retProxy -> do 29new prim streamName storage toAttr sz = fix $ \retProxy -> do
30 let paramProxy = paramProxy' retProxy 30 let paramProxy = paramProxy' retProxy
31 where paramProxy' :: io (targetbuffer (keys -> writer)) -> Proxy keys 31 where paramProxy' :: io (targetbuffer (keys -> writer)) -> Proxy keys
32 paramProxy' _ = Proxy 32 paramProxy' _ = Proxy
33 let ps = fieldParameters paramProxy toAttr 33 let ps = fieldParameters paramProxy toAttr
34 putStrLn $ "Ring params: " ++ show ps 34 putStrLn $ "Ring params: " ++ show ps
35 gd0 <- uploadDynamicBuffer sz ps 35 gd0 <- uploadDynamicBuffer sz ps
36 let gd = gd0 { dPrimitive = LineStrip } 36 let gd = gd0 { dPrimitive = prim }
37 Just keys <- return $ lookupAttrKeys (lookupAttributeKey gd . toAttr) 37 Just keys <- return $ lookupAttrKeys (lookupAttributeKey gd . toAttr)
38 obj <- addToObjectArray storage streamName [] gd 38 obj <- addToObjectArray storage streamName [] gd
39 -- readIORef (objCommands obj) >>= mapM_ print 39 -- readIORef (objCommands obj) >>= mapM_ print