This commit is contained in:
Courtney Strachan
2025-10-23 03:18:03 -04:00
parent 7c2101ea3d
commit e724b23aac
+6
View File
@@ -2112,7 +2112,9 @@ async function runWasm(wasmPath, consoleElement, extraForeignImports, wasmMemory
wasmMemoryInterface.setMemory(exports.memory);
}
if (exports._start) {
exports._start();
}
// Define a `@export step :: proc(delta_time: f64) -> (keep_going: bool) {`
// in your app and it will get called every frame.
@@ -2130,7 +2132,9 @@ async function runWasm(wasmPath, consoleElement, extraForeignImports, wasmMemory
prevTimeStamp = currTimeStamp;
if (!exports.step(dt, odin_ctx)) {
if (exports._end) {
exports._end();
}
return;
}
@@ -2139,8 +2143,10 @@ async function runWasm(wasmPath, consoleElement, extraForeignImports, wasmMemory
window.requestAnimationFrame(step);
} else {
if (exports._end) {
exports._end();
}
}
return;
};