module Idle (idle) where import Graphics.Rendering.OpenGL import Graphics.UI.GLUT import Data.IORef import ProgEnd import States import EventFlags import MainState import DisplayState import System.Random idle :: (IORef MState) -> (IORef KState) -> (IORef DState) -> IO() idle mst kst dst = do mst' <- readIORef mst kst' <- readIORef kst dst' <- readIORef dst gen <- getStdGen if (endD mst' kst') == True then actionOnWindowClose $=! Exit else do dst $=! (newDState mst' kst' dst') mst $=! (newMState mst' kst' dst') postRedisplay Nothing