diff --git a/src/xrEngine/Device_Initialize.cpp b/src/xrEngine/Device_Initialize.cpp index 936eada9d66..98ea3a83e3a 100644 --- a/src/xrEngine/Device_Initialize.cpp +++ b/src/xrEngine/Device_Initialize.cpp @@ -41,7 +41,7 @@ void CRenderDevice::Initialize() if (strstr(Core.Params, "-weather")) initialize_weather_editor(); - R_ASSERT3(SDL_Init(SDL_INIT_EVERYTHING) == 0, "Unable to initialize SDL", SDL_GetError()); + R_ASSERT3(SDL_Init(SDL_INIT_VIDEO) == 0, "Unable to initialize SDL", SDL_GetError()); if (!m_sdlWnd) { diff --git a/src/xrEngine/xr_input.cpp b/src/xrEngine/xr_input.cpp index dc6330bdd81..2dcee832325 100644 --- a/src/xrEngine/xr_input.cpp +++ b/src/xrEngine/xr_input.cpp @@ -86,7 +86,7 @@ void CInput::SetKBDAcquire(bool bAcquire) {} void CInput::MouseUpdate() { - SDL_Event event; + SDL_PumpEvents(); bool mouse_prev[COUNT_MOUSE_BUTTONS]; @@ -101,6 +101,8 @@ void CInput::MouseUpdate() bool mouseMoved = false; offs[0] = offs[1] = offs[2] = 0; + + SDL_Event event; while (SDL_PeepEvents(&event, 1, SDL_GETEVENT, SDL_MOUSEMOTION, SDL_MOUSEWHEEL)) { switch (event.type) @@ -163,6 +165,8 @@ void CInput::MouseUpdate() void CInput::KeyUpdate() { + SDL_PumpEvents(); + SDL_Event event; while (SDL_PeepEvents(&event, 1, SDL_GETEVENT, SDL_KEYDOWN, SDL_KEYMAPCHANGED)) { @@ -331,8 +335,8 @@ void CInput::OnFrame(void) if (Device.dwPrecacheFrame == 0) { - MouseUpdate(); KeyUpdate(); + MouseUpdate(); } stats.FrameTime.End();