Examples: Fix crash/high CPU usage when minimized

This commit is contained in:
SirLynix
2022-06-16 19:57:40 +02:00
parent 976bc09079
commit f3c889c5d5
7 changed files with 41 additions and 0 deletions

View File

@@ -15,8 +15,10 @@
#include <Nazara/Utility/Components.hpp>
#include <entt/entt.hpp>
#include <array>
#include <chrono>
#include <iostream>
#include <limits>
#include <thread>
NAZARA_REQUEST_DEDICATED_GPU()
@@ -360,7 +362,10 @@ int main()
Nz::RenderFrame frame = window.AcquireFrame();
if (!frame)
{
std::this_thread::sleep_for(std::chrono::milliseconds(1));
continue;
}
renderSystem.Render(registry, frame);