aboutsummaryrefslogtreecommitdiff
path: root/tr8vm.c
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-05-08 23:53:08 +0100
committerJuan J. Martinez <jjm@usebox.net>2023-05-08 23:53:08 +0100
commit9a2a7faecfa783f154937cfd1d6cbd8e59b86b1f (patch)
tree1e88d89f0e2a182f3bc0e7b3ce0fcb65d26eea5c /tr8vm.c
parent53dcec8caa5943c7fa5d4a55072289c62b62b545 (diff)
downloadtr8vm-9a2a7faecfa783f154937cfd1d6cbd8e59b86b1f.tar.gz
tr8vm-9a2a7faecfa783f154937cfd1d6cbd8e59b86b1f.zip
Process all the events
Diffstat (limited to 'tr8vm.c')
-rw-r--r--tr8vm.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/tr8vm.c b/tr8vm.c
index 41ce6eb..aa15ecc 100644
--- a/tr8vm.c
+++ b/tr8vm.c
@@ -284,12 +284,14 @@ int main(int argc, char *argv[])
SDL_UnlockTexture(fb);
SDL_Event ev;
- while (1)
+ uint8_t quit = 0;
+
+ while (!quit)
{
- if (SDL_PollEvent(&ev))
+ while (SDL_PollEvent(&ev))
{
if (ev.type == SDL_QUIT)
- break;
+ quit = 1;
if (ev.type == SDL_KEYDOWN)
{
@@ -297,13 +299,12 @@ int main(int argc, char *argv[])
{
if (fullscreen)
resize_full_screen(screen, renderer, 0, &dst);
- break;
+ quit = 1;
}
if (ev.key.keysym.sym == SDLK_RETURN && (SDL_GetModState() & KMOD_LALT))
{
fullscreen ^= 1;
resize_full_screen(screen, renderer, fullscreen, &dst);
- continue;
}
}
}