testspriteminimal: only quit when escape is pressed

This commit is contained in:
Sam Lantinga 2024-10-23 10:51:14 -07:00
parent acfc223e15
commit 370c0426ce

View File

@ -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;
}
}