From 2d89afcf5a50aac49709c90a293374b18aaa2db2 Mon Sep 17 00:00:00 2001 From: Joe Crayne Date: Sun, 19 May 2019 22:44:20 -0400 Subject: Interface tweak to PointPrimitive ring buffer. --- PointPrimitiveRing.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'PointPrimitiveRing.hs') diff --git a/PointPrimitiveRing.hs b/PointPrimitiveRing.hs index 47819e3..3647d4a 100644 --- a/PointPrimitiveRing.hs +++ b/PointPrimitiveRing.hs @@ -84,11 +84,11 @@ updateRingCommands r = do readIORef (objCommands $ rObject r) >>= mapM_ print return () -pushBack :: Ring keys -> Writer [DSum AttributeKey GLUniformValue] a -> IO () +pushBack :: Ring keys -> (keys -> Writer [DSum AttributeKey GLUniformValue] a) -> IO () pushBack r attrs = do back <- readIORef $ rBack r writeIORef (rBack r) (mod (back + 1) (ringCapacity r)) - updateAttributes back attrs + updateAttributes back $ attrs (rKeys r) sz <- readIORef (rSize r) when (sz < ringCapacity r) $ writeIORef (rSize r) (sz + 1) updateRingCommands r -- cgit v1.2.3