add mRestart flag to immediately request the thread exits to force a commit frame
This commit is contained in:
@@ -63,11 +63,22 @@ public:
|
|||||||
*/
|
*/
|
||||||
void iter();
|
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__
|
#ifdef __EMSCRIPTEN__
|
||||||
emscripten::ProxyingQueue queue;
|
emscripten::ProxyingQueue queue;
|
||||||
@@ -76,6 +87,7 @@ public:
|
|||||||
|
|
||||||
bool mRendered = false;
|
bool mRendered = false;
|
||||||
bool mRender = false;
|
bool mRender = false;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::mutex _taskMutex;
|
std::mutex _taskMutex;
|
||||||
std::condition_variable _cv;
|
std::condition_variable _cv;
|
||||||
@@ -84,6 +96,7 @@ private:
|
|||||||
int _frameCount = 0;
|
int _frameCount = 0;
|
||||||
float _accumulatedTime = 0.0f;
|
float _accumulatedTime = 0.0f;
|
||||||
float _fps = 0.0f;
|
float _fps = 0.0f;
|
||||||
|
|
||||||
|
|
||||||
#ifdef __EMSCRIPTEN__
|
#ifdef __EMSCRIPTEN__
|
||||||
pthread_t t;
|
pthread_t t;
|
||||||
|
|||||||
Reference in New Issue
Block a user