Skip to content

Commit

Permalink
- ignore SDL_WaitEvent errors
Browse files Browse the repository at this point in the history
  • Loading branch information
madame-rachelle authored and dpjudas committed Apr 25, 2024
1 parent 3e7cd6a commit f8b1271
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/window/sdl2/sdl2displaywindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,11 +286,10 @@ void SDL2DisplayWindow::RunLoop()

while (!ExitRunLoop)
{
SDL_Event event;
SDL_Event event = {};
int result = SDL_WaitEvent(&event);
if (result == 0)
fprintf(stderr, "SDL_WaitEvent failed: %s\n", SDL_GetError());
DispatchEvent(event);
if (result == 1)
DispatchEvent(event); // Silently ignore if it fails and pray it doesn't busy loop, because SDL and Linux utterly sucks!
}
}

Expand Down

0 comments on commit f8b1271

Please sign in to comment.