call an exported start function if it exists

This commit is contained in:
2023-01-28 12:31:16 +01:00
parent 30eb953d5d
commit 5d85aeac09
4 changed files with 14 additions and 1 deletions

View File

@@ -134,6 +134,10 @@ impl super::Runtime for MicroW8 {
let end_frame = platform_instance.get_typed_func::<(), ()>(&mut store, "endFrame")?;
let update = instance.get_typed_func::<(), ()>(&mut store, "upd").ok();
if let Some(start) = instance.get_typed_func::<(), ()>(&mut store, "start").ok() {
start.call(&mut store, ())?;
}
let (sound_tx, stream) = if self.disable_audio {
(None, None)
} else {