add EMSCRIPTEN guards around thread waiting ResourceBuffer

This commit is contained in:
Nick Fisher
2024-05-11 10:11:50 +08:00
parent cfbfc87b0b
commit dbf44f1c8b

View File

@@ -4,9 +4,11 @@
#include "ResourceBuffer.h"
#if defined(__cplusplus)
#ifndef __EMSCRIPTEN__
#include <thread>
using namespace std::chrono_literals;
#endif
namespace flutter_filament
{
@@ -39,7 +41,9 @@ namespace flutter_filament
loadToOut(uri, &rb);
while (rb.size == 0)
{
#if! __EMSCRIPTEN__
std::this_thread::sleep_for(100ms);
#endif
}
return rb;