changed polling for events to blocking call
This commit is contained in:
@ -16,8 +16,11 @@ Application Application::app;
|
||||
void Application::run() {
|
||||
bool quit {false};
|
||||
while (!quit) {
|
||||
for (const Window& window : Window::windows()) {
|
||||
window.update();
|
||||
}
|
||||
SDL_Event event;
|
||||
if (SDL_PollEvent(&event)) {
|
||||
if (SDL_WaitEvent(&event)) {
|
||||
switch (event.type) {
|
||||
case SDL_QUIT:
|
||||
quit = true;
|
||||
@ -29,9 +32,6 @@ void Application::run() {
|
||||
quit = handle_event(event);
|
||||
}
|
||||
}
|
||||
for (const Window& window : Window::windows()) {
|
||||
window.update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user