Skip to content

Commit

Permalink
tools/player: handle SDL_QUIT event
Browse files Browse the repository at this point in the history
Allows the player to handle SIGINT (Ctrl+C).
  • Loading branch information
mbouron committed May 17, 2024
1 parent 5353b9e commit 67ab1b6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ngl-tools/player.c
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,9 @@ void player_main_loop(struct player *p)
SDL_Event event;
while (SDL_PollEvent(&event)) {
switch (event.type) {
case SDL_QUIT:
run = 0;
break;
case SDL_WINDOWEVENT:
if (event.window.event == SDL_WINDOWEVENT_CLOSE)
run = 0;
Expand Down

0 comments on commit 67ab1b6

Please sign in to comment.