wasm, app
This commit is contained in:
@@ -99,7 +99,6 @@ class memory_t {
|
||||
|
||||
const canvas = document.getElementById("canvas");
|
||||
const ctx2d = canvas.getContext('2d');
|
||||
const mem = new memory_t(new WebAssembly['Memory']({ initial: 2000, maximum: 65536 }));
|
||||
|
||||
(async function main() {
|
||||
if (!ctx2d) {
|
||||
@@ -107,6 +106,7 @@ const mem = new memory_t(new WebAssembly['Memory']({ initial: 2000, maximum: 655
|
||||
return;
|
||||
}
|
||||
|
||||
const mem = new memory_t(new WebAssembly['Memory']({ initial: 2000, maximum: 65536 }));
|
||||
const request = await fetch('main.wasm');
|
||||
const binary = await request.arrayBuffer();
|
||||
|
||||
@@ -139,7 +139,6 @@ const mem = new memory_t(new WebAssembly['Memory']({ initial: 2000, maximum: 655
|
||||
};
|
||||
|
||||
let wasm_app_imports = {
|
||||
|
||||
// core
|
||||
memory: mem.mem,
|
||||
wasm_parse_float: (str, len) => { return parseFloat(mem.read_cstr(str, len)); },
|
||||
@@ -192,7 +191,7 @@ const mem = new memory_t(new WebAssembly['Memory']({ initial: 2000, maximum: 655
|
||||
mem.exports = wasm_exports;
|
||||
wasm_exports['wasm_init']();
|
||||
|
||||
let awake = false;
|
||||
let awake = true;
|
||||
|
||||
function wasm_update(time) {
|
||||
const dpr = window.devicePixelRatio;
|
||||
|
||||
Reference in New Issue
Block a user