diff --git a/src/Affection.hs b/src/Affection.hs index 9ff09b9..f0c0d93 100644 --- a/src/Affection.hs +++ b/src/Affection.hs @@ -88,13 +88,14 @@ withAffection AffectionConfig{..} = do updateLoop $ (fromIntegral $ toNanoSecs $ diffTimeSpec lastTime now) / (fromIntegral 10 ^ 9) -- handle all new draw requests - clear <- catMaybes <$> mapM (handleDrawRequest pixels format stride cpp) (drawStack ad) + ad2 <- get + clear <- catMaybes <$> mapM (handleDrawRequest pixels format stride cpp) (drawStack ad2) -- save all draw requests to clear in next run - put $ ad + put $ ad2 { drawStack = clear } -- blit surface and update window liftIO $ SDL.surfaceBlit surface Nothing oldSurf Nothing - liftIO $ SDL.updateWindowSurface $ drawWindow ad + liftIO $ SDL.updateWindowSurface $ drawWindow ad2 -- save new time _ <- liftIO $ swapMVar execTime $ now return ()