Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDL: Switch to SDL_WaitEventTimeout instead of SDL_PollEvent when possible. #19207

Merged
merged 1 commit into from
May 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions SDL/SDLMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1420,10 +1420,12 @@ int main(int argc, char *argv[]) {
bool waitOnExit = g_Config.iGPUBackend == (int)GPUBackend::OPENGL;

if (!mainThreadIsRender) {
// We should only be a message pump
// Vulkan mode uses this.
// We should only be a message pump. This allows for lower latency
// input events, and so on.
while (true) {
SDL_Event event;
while (SDL_PollEvent(&event)) {
while (SDL_WaitEventTimeout(&event, 100)) {
ProcessSDLEvent(window, event, &inputTracker);
}
if (g_QuitRequested || g_RestartRequested)
Expand Down
Loading