Break SDL_PeepEvents loop on error (bug #6890)

This commit is contained in:
Alexei Kotov 2022-08-01 06:24:45 +03:00
parent 9a4df75f3c
commit bb2fa1cbfa
2 changed files with 2 additions and 1 deletions

View file

@ -53,7 +53,7 @@ InputWrapper::InputWrapper(SDL_Window* window, osg::ref_ptr<osgViewer::Viewer> v
if (windowEventsOnly)
{
// During loading, handle window events, discard button presses and keep others for later
while (SDL_PeepEvents(&evt, 1, SDL_GETEVENT, SDL_WINDOWEVENT, SDL_WINDOWEVENT))
while (SDL_PeepEvents(&evt, 1, SDL_GETEVENT, SDL_WINDOWEVENT, SDL_WINDOWEVENT) > 0)
handleWindowEvent(evt);
SDL_FlushEvent(SDL_KEYDOWN);