summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Crayne <joe@jerkface.net>2019-05-30 11:27:48 -0400
committerJoe Crayne <joe@jerkface.net>2019-05-30 11:27:48 -0400
commit3688556416bb02c278802e0b988058a102bd1b3a (patch)
tree35da4546c8397a1da1d73a4ba4be17861a1d6f95
parent16de6189e7bb6c7ee2cc8d3236d3f8bf666f2e68 (diff)
Avoid passing an empty range to OpenGL DrawArrays.
-rw-r--r--RingBuffer.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/RingBuffer.hs b/RingBuffer.hs
index dd8a7f7..6ce36bc 100644
--- a/RingBuffer.hs
+++ b/RingBuffer.hs
@@ -45,8 +45,8 @@ ringMask r = do
45 mask cnt 45 mask cnt
46 | cnt==size = [(0,cnt)] 46 | cnt==size = [(0,cnt)]
47 | otherwise = case cnt + back - size of 47 | otherwise = case cnt + back - size of
48 front | front > cnt -> [(front - cnt,size)] 48 front | front >= cnt -> [(front - cnt,size)]
49 | otherwise -> [(0,back), (front,cnt - front)] 49 | otherwise -> [(0,back), (front,cnt - front)]
50 return mask 50 return mask
51 51
52syncRing :: RingBuffer u -> IO () 52syncRing :: RingBuffer u -> IO ()