Refactor event handling in Controller::OnInput to use SDL_WaitEvent instead of polling; improves efficiency by reducing CPU usage during event processing.

This commit is contained in:
scawful
2025-04-20 17:37:05 -04:00
parent 97bb0a8bc6
commit c0c6374539

View File

@@ -64,7 +64,7 @@ void Controller::OnInput() {
ImGuiIO &io = ImGui::GetIO();
SDL_Event event;
while (SDL_PollEvent(&event)) {
SDL_WaitEvent(&event);
ImGui_ImplSDL2_ProcessEvent(&event);
switch (event.type) {
case SDL_KEYDOWN:
@@ -91,7 +91,6 @@ void Controller::OnInput() {
default:
break;
}
}
int mouseX;
int mouseY;