Skip to content

Commit

Permalink
Merge pull request #254 from turion/fix_gloss_io
Browse files Browse the repository at this point in the history
Fix gloss event clock again
  • Loading branch information
turion authored Oct 4, 2023
2 parents cba1490 + a7991c2 commit 59efe9f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rhine-gloss/src/FRP/Rhine/Gloss/IO.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ where

-- base
import Control.Concurrent
import Control.Monad (when)
import Data.Functor (void)
import Data.IORef

Expand Down Expand Up @@ -142,9 +143,8 @@ launchGlossThread GlossSettings {..} = do
simStep diffTime vars@GlossEnv {timeVar, timeRef} = do
time <- readIORef timeRef
let !time' = time + diffTime
liftIO $ print time'
void $ tryPutMVar timeVar time'
writeIORef timeRef time'
timeUpdate <- tryPutMVar timeVar time'
when timeUpdate $ writeIORef timeRef time'
return vars
void $ liftIO $ forkIO $ playIO display backgroundColor stepsPerSecond vars getPic handleEvent simStep
return vars
Expand Down

0 comments on commit 59efe9f

Please sign in to comment.