first commit
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
|
||||
(async () => {
|
||||
await import("./odin.js"); // from the 'sys/wasm/js'
|
||||
|
||||
let mem = new odin.WasmMemoryInterface()
|
||||
|
||||
let js_log = {
|
||||
trace: (str_ptr, str_len) => console.trace(mem.loadString(str_ptr, str_len)),
|
||||
debug: (str_ptr, str_len) => console.debug(mem.loadString(str_ptr, str_len)),
|
||||
info : (str_ptr, str_len) => console.info(mem.loadString(str_ptr, str_len)),
|
||||
warn : (str_ptr, str_len) => console.warn(mem.loadString(str_ptr, str_len)),
|
||||
error: (str_ptr, str_len) => console.error(mem.loadString(str_ptr, str_len)),
|
||||
};
|
||||
|
||||
let extra = {
|
||||
'js_log' : js_log
|
||||
};
|
||||
await odin.runWasm("./game.wasm", null, extra, mem);
|
||||
})();
|
||||
Reference in New Issue
Block a user