diff options
author | Joe Crayne <joe@jerkface.net> | 2019-05-24 21:11:14 -0400 |
---|---|---|
committer | Joe Crayne <joe@jerkface.net> | 2019-05-24 21:11:14 -0400 |
commit | 786e58ccbb05ced78c5421b53fbc469971d7db82 (patch) | |
tree | 0c60c0bbfd357c3d21d849dd61ecfb50d7ac1cc7 /PointPrimitiveRing.hs | |
parent | a2aa65ffc5a4fc6cd0f41ccab1516f85a27989b2 (diff) |
Add curvature-coloring.
Diffstat (limited to 'PointPrimitiveRing.hs')
-rw-r--r-- | PointPrimitiveRing.hs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/PointPrimitiveRing.hs b/PointPrimitiveRing.hs index 3647d4a..c458421 100644 --- a/PointPrimitiveRing.hs +++ b/PointPrimitiveRing.hs | |||
@@ -81,7 +81,7 @@ updateRingCommands r = do | |||
81 | front | front > cnt -> [(front - cnt,size)] | 81 | front | front > cnt -> [(front - cnt,size)] |
82 | | otherwise -> [(0,back), (front,cnt - front)] | 82 | | otherwise -> [(0,back), (front,cnt - front)] |
83 | updateCommands (rStorage r) (rObject r) mask | 83 | updateCommands (rStorage r) (rObject r) mask |
84 | readIORef (objCommands $ rObject r) >>= mapM_ print | 84 | -- readIORef (objCommands $ rObject r) >>= mapM_ print |
85 | return () | 85 | return () |
86 | 86 | ||
87 | pushBack :: Ring keys -> (keys -> Writer [DSum AttributeKey GLUniformValue] a) -> IO () | 87 | pushBack :: Ring keys -> (keys -> Writer [DSum AttributeKey GLUniformValue] a) -> IO () |
@@ -93,5 +93,10 @@ pushBack r attrs = do | |||
93 | when (sz < ringCapacity r) $ writeIORef (rSize r) (sz + 1) | 93 | when (sz < ringCapacity r) $ writeIORef (rSize r) (sz + 1) |
94 | updateRingCommands r | 94 | updateRingCommands r |
95 | 95 | ||
96 | updateBack :: Ring keys -> (keys -> Writer [DSum AttributeKey GLUniformValue] a) -> IO () | ||
97 | updateBack r attrs = do | ||
98 | back <- readIORef $ rBack r | ||
99 | updateAttributes (mod (back - 1) (ringCapacity r)) $ attrs (rKeys r) | ||
100 | |||
96 | updateRingUniforms :: GLStorage -> Ring keys -> IO () | 101 | updateRingUniforms :: GLStorage -> Ring keys -> IO () |
97 | updateRingUniforms _ _ = return () | 102 | updateRingUniforms _ _ = return () |