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

@@ -7,8 +7,10 @@
#include <NZSL/FieldOffsets.hpp>
#include <NZSL/Parser.hpp>
#include <array>
#include <chrono>
#include <iostream>
#include <random>
#include <thread>
NAZARA_REQUEST_DEDICATED_GPU()
@@ -1176,7 +1178,10 @@ int main()
Nz::RenderFrame frame = window.AcquireFrame();
if (!frame)
{
std::this_thread::sleep_for(std::chrono::milliseconds(1));
continue;
}
currentFrame = &frame;