Ver código fonte

testspriteminimal: only quit when escape is pressed

Sam Lantinga 11 meses atrás
pai
commit
370c0426ce
1 arquivos alterados com 2 adições e 1 exclusões
  1. 2 1
      test/testspriteminimal.c

+ 2 - 1
test/testspriteminimal.c

@@ -93,7 +93,8 @@ static void loop(void)
 
     /* Check for events */
     while (SDL_PollEvent(&event)) {
-        if (event.type == SDL_EVENT_QUIT || event.type == SDL_EVENT_KEY_DOWN) {
+        if (event.type == SDL_EVENT_QUIT ||
+            (event.type == SDL_EVENT_KEY_DOWN && event.key.key == SDLK_ESCAPE)) {
             done = 1;
         }
     }