refactoring

This commit is contained in:
Nick Fisher
2025-03-19 21:52:59 +08:00
parent a310498c5a
commit 931aab5159
12 changed files with 82 additions and 10 deletions
@@ -50,6 +50,15 @@ extern "C"
}
}
EMSCRIPTEN_KEEPALIVE void RenderLoop_addTask(void (*task)()) {
std::packaged_task<void()> lambda(
[=]() mutable
{
task();
});
auto fut = _rl->add_task(lambda);
}
EMSCRIPTEN_KEEPALIVE void RenderLoop_requestAnimationFrame(void (*onComplete)()) {
_rl->requestFrame(onComplete);
}