Skip to content

Commit

Permalink
Merge pull request #53 from ryuukk/patch-4
Browse files Browse the repository at this point in the history
Save ressources when window is minimized
  • Loading branch information
Wires77 authored Mar 28, 2024
2 parents c9e1865 + a5ed67d commit 61477ee
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions engine/system/win/sys_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -842,14 +842,18 @@ bool sys_main_c::Run(int argc, char** argv)

// Run frame loop
while (exitFlag == false) {
glfwPollEvents();
if (minimized) {
glfwWaitEventsTimeout(0.1);
}
else {
glfwPollEvents();
}
auto wnd = (GLFWwindow*)video->GetWindowHandle();
if (glfwWindowShouldClose(wnd)) {
Exit();
break;
}
if (minimized == false)
core->Frame();
core->Frame();

if (threadError) {
Error(threadError);
Expand Down

0 comments on commit 61477ee

Please sign in to comment.