diff --git a/application/application.cpp b/application/application.cpp index 22293bb3c..f2cb51931 100644 --- a/application/application.cpp +++ b/application/application.cpp @@ -685,6 +685,10 @@ int eu07_application::run() { auto frame{0}; frame_pacer framepacer; + // the window of the test mode is hidden and takes no input: its messages are looked at a few times a second. looked for + // every frame, PeekMessage gives up the rest of the time slice of the thread when there are none, which in a short frame + // came to a tenth of it + auto nextpoll{std::chrono::steady_clock::now()}; Timer::subsystem.mainloop_period.start(); // main application loop while (!glfwWindowShouldClose(m_windows.front()) && !m_modestack.empty()) @@ -695,7 +699,11 @@ int eu07_application::run() Timer::subsystem.mainloop_total.start(); GfxRenderer->Frame_Start(); Timer::subsystem.loop_input.start(); - glfwPollEvents(); + if (false == Global.test.enabled || std::chrono::steady_clock::now() >= nextpoll) + { + glfwPollEvents(); + nextpoll = std::chrono::steady_clock::now() + std::chrono::milliseconds{50}; + } if (m_headtrack) m_headtrack->update();