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 idle :: (IORef MState) -> (IORef KState) -> (IORef DState) -> IO() idle mst kst dst= do mst' <- readIORef mst kst' <- readIORef kst dst' <- readIORef dst if (endD mst' kst') == True then actionOnWindowClose $=! Exit else do kst $=! (kStateUpdatePreKey kst') mst $=! (newMState mst' dst' kst' ) postRedisplay Nothing