Skip to content

Commit

Permalink
Added 5ms sleep when minimised to reduce CPU load
Browse files Browse the repository at this point in the history
- Should probably be redesigned in future
  • Loading branch information
TheCherno committed Jul 17, 2023
1 parent f25e1c3 commit 7e478a3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Walnut/Platform/GUI/Walnut/ApplicationGUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,8 @@ namespace Walnut {
// Present Main Platform Window
if (!main_is_minimized)
FramePresent(wd);
else
std::this_thread::sleep_for(std::chrono::milliseconds(5));

float time = GetTime();
m_FrameTime = time - m_LastFrameTime;
Expand Down

0 comments on commit 7e478a3

Please sign in to comment.