wasm builds

This commit is contained in:
Sebastian Moser
2024-08-27 11:50:18 +02:00
parent 39cf7f5ee3
commit 31e071078a
8 changed files with 36 additions and 13 deletions

View File

@@ -2,6 +2,9 @@ mod utils;
use wasm_bindgen::prelude::*;
use crate::instance::Instance;
use crate::error::MizeResult;
// When the `wee_alloc` feature is enabled, use `wee_alloc` as the global
// allocator.
#[cfg(feature = "wee_alloc")]
@@ -17,3 +20,10 @@ extern {
pub fn greet() {
alert("Hello, wasm-game-of-life!");
}
pub fn wasm_instance_init(instance: &mut Instance) -> MizeResult<()> {
println!("Hello world from wasm_instance_init!!!!!!!!!!");
alert("Hello world from wasm_instance_init!!!!!!!!!!");
Ok(())
}