]> git.itanic.dy.fi Git - sdl-planets/commitdiff
Only exit when esc key is pressed
authorTimo Kokkonen <kaapeli@itanic.dy.fi>
Sat, 6 Feb 2010 09:06:39 +0000 (11:06 +0200)
committerTimo Kokkonen <kaapeli@itanic.dy.fi>
Sat, 6 Feb 2010 09:06:39 +0000 (11:06 +0200)
Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
main.c

diff --git a/main.c b/main.c
index ba322840960a1cf6ebb5483252db9854d1db3204..45a8f98c164f6a58c96658966b36fb2793059399 100644 (file)
--- a/main.c
+++ b/main.c
@@ -53,8 +53,9 @@ static void loop(SDL_Surface *screen)
                SDL_Flip(screen);
 
                while(SDL_PollEvent(&event)) {
-                       if (event.type == SDL_KEYDOWN) {
-                               printf("Exiting. Good bye!\n");
+                       if (event.type == SDL_KEYDOWN &&
+                           event.key.keysym.sym == SDLK_ESCAPE) {
+                               printf("\nExiting. Good bye!\n");
                                return;
                        }
                }