On 17/05/11 01:42, Michael Serra wrote:
eventLoop w cs = do
drawCells w cs
e <- waitEventBlocking
checkEvent e
where
checkEvent (KeyUp (Keysym SDLK_ESCAPE _ _)) = return ()
checkEvent (KeyUp (Keysym SDLK_n _ _)) = eventLoop w $
nextgen cs
checkEvent _
Oh, in case the code would be helpful.. ;)
import Data.Set (toList, fromList, intersection, size)
import Data.List ((\\))
import System.Random (randomRIO)
import Data.Word (Word32)
import Graphics.UI.SDL as SDL
main = do
SDL.init [InitVideo, InitTimer, InitEventthread]
w <- setVideoMode 1440
Greetings Haskellers,
I'm relatively new to the language and I'm writing a basic game of life
simulation to try out the SDL bindings. The program updates the window with
the next generation of cells each time you press 'n', and the problem I'm
finding is that every so often the window stops upda