Skip to content

Commit 6f6c0f1

Browse files
committed
Replace PollEvent with WaitEvent to avoid unnecessary cpu usage
1 parent 7dea1b3 commit 6f6c0f1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ui/Window.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ void UI::Window::clearScreen() {
9494
void UI::Window::pollEvents() {
9595
SDL_Event windowEvent;
9696

97-
if (SDL_PollEvent(&windowEvent)) {
97+
if (SDL_WaitEvent(&windowEvent)) {
9898
if (windowEvent.type == SDL_QUIT) {
9999
closed = true;
100100
} else if (windowEvent.type == SDL_KEYUP) {

0 commit comments

Comments
 (0)