From 6444d175a79ba6a12ee12bd14e05d4b5380ca6b4 Mon Sep 17 00:00:00 2001 From: William Fisher Date: Mon, 6 Aug 2018 23:21:35 +0100 Subject: [PATCH] Adds 'destroyWindow' call to main example in SDL.hs The getting started example in SDL.hs doesn't call 'destroyWindow' and so leaves windows around. This adds this call and an additional comment to explain in the example. --- src/SDL.hs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/SDL.hs b/src/SDL.hs index ac7d0d8..ab694bb 100644 --- a/src/SDL.hs +++ b/src/SDL.hs @@ -75,12 +75,18 @@ If you wish to use SDL's 2D graphics API, you can also create a 'Renderer': renderer <- 'createRenderer' window (-1) 'defaultRenderer' @ -Finally, we enter our main application loop: +Then, we enter our main application loop: @ appLoop renderer @ +Finally, once our appLoop has returned we destroy the 'Window' using 'destroyWindow': + +@ + 'destroyWindow' window +@ + For the body of your application, we enter a loop. Inside this loop you should begin by collecting all events that have happened - these events will inform you about information such as key presses and mouse movement: @@ -134,6 +140,7 @@ main = do window <- 'createWindow' "My SDL Application" 'defaultWindow' renderer <- 'createRenderer' window (-1) 'defaultRenderer' appLoop renderer + destroyWindow window appLoop :: 'Renderer' -> IO () appLoop renderer = do