clear out SDL events to center mouse (#1596)

* apply Ceski's changes
This commit is contained in:
Roman Fomin 2024-03-16 21:27:37 +07:00 committed by GitHub
parent a1753be2b2
commit f001b48f8f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1729,6 +1729,11 @@ void I_InitGraphics(void)
ResetResolution(CurrentResolutionHeight(), true);
CreateSurfaces(video.pitch, video.height);
ResetLogicalSize();
// clear out events waiting at the start and center the mouse
SDL_PumpEvents();
SDL_FlushEvent(SDL_MOUSEMOTION);
I_ResetRelativeMouseState();
}
//----------------------------------------------------------------------------