add mRestart flag to immediately request the thread exits to force a commit frame

This commit is contained in:
Nick Fisher
2025-06-23 12:43:03 +08:00
parent a8a7f11d44
commit e27be37378

View File

@@ -63,11 +63,22 @@ public:
*/
void iter();
/**
* On emscripten builds, this breaks the current loop and
* immediately exits, yielding to the main browser loop.
* On other builds, this does nothing.
*/
void restart();
/**
*
*/
bool _stop = false;
bool mStop = false;
/**
*
*/
bool mRestart = false;
#ifdef __EMSCRIPTEN__
emscripten::ProxyingQueue queue;
@@ -76,6 +87,7 @@ public:
bool mRendered = false;
bool mRender = false;
private:
std::mutex _taskMutex;
std::condition_variable _cv;
@@ -85,6 +97,7 @@ private:
float _accumulatedTime = 0.0f;
float _fps = 0.0f;
#ifdef __EMSCRIPTEN__
pthread_t t;
#else