use flush() instead of manually invoking different methods for wasm/native

This commit is contained in:
Nick Fisher
2025-05-22 15:08:29 +08:00
parent 1b3d46533c
commit 1373ce5a32

View File

@@ -115,13 +115,7 @@ class ThermionViewerFFI extends ThermionViewer {
Future render() async {
await withVoidCallback((requestId, cb) => RenderTicker_renderRenderThread(
app.renderTicker, 0.toBigInt, requestId, cb));
if (FILAMENT_SINGLE_THREADED) {
await withVoidCallback((requestId, cb) =>
Engine_executeRenderThread(app.engine, requestId, cb));
} else {
await withVoidCallback((requestId, cb) =>
Engine_flushAndWaitRenderThread(app.engine, requestId, cb));
}
await FilamentApp.instance!.flush();
}
double _msPerFrame = 1000.0 / 60.0;