set window focus on startup (#641)

* clear out any events waiting at the start and center the mouse

* actually we just need to set window_focused = true as in Chocolate Doom

Clearing events at startup disables gamepad recognition.
This commit is contained in:
Roman Fomin 2022-07-03 14:48:51 +07:00 committed by GitHub
parent 3b7e955c75
commit 3ad830f5aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -292,7 +292,7 @@ int grabmouse = 1;
// Flag indicating whether the screen is currently visible:
// when the screen isnt visible, don't render the screen
boolean screenvisible;
static boolean window_focused;
static boolean window_focused = true;
boolean fullscreen;
//
@ -697,8 +697,6 @@ void I_GetEvent(void)
{
SDL_Event sdlevent;
SDL_PumpEvents();
while (SDL_PollEvent(&sdlevent))
{
switch (sdlevent.type)