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