From f5ae4962560e7d0dc9b2937a0d4f05849fb61ada Mon Sep 17 00:00:00 2001 From: nek0 Date: Sun, 17 May 2020 17:30:05 +0200 Subject: [PATCH] make red channel cycle --- src/Main.hs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Main.hs b/src/Main.hs index 8c704e5..59f170f 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -191,6 +191,15 @@ main = do err <- get GL.errors when (not $ null err) (print $ "loop errors: " <> show err) + -- update MVAr values + putMVar red newRed + -- cycle the increment for red if neccessary + if (newRed + incrementValue > 1 || newRed + incrementValue < 0) + then + putMVar increment (-incrementValue) + else + putMVar increment incrementValue + -- make GL finish things up -- GL.flush -- draw context on screen