module Idle (idle) where import Graphics.Rendering.OpenGL import Graphics.UI.GLUT import Data.IORef import ProgEnd import States import DisplayState --import EventFlags import MainState --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 kst $=! (kStateUpdatePreKey kst') dst $=! (newDState mst' kst' dst') mst $=! (newMState mst' dst' kst' ) postRedisplay Nothing