update example web project

This commit is contained in:
Nick Fisher
2024-05-21 10:15:15 +08:00
parent ece018b7e9
commit 90727e79c5
7 changed files with 4 additions and 78 deletions

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
../../../../dart_filament/native/web/build/build/out/dart_filament.js

View File

@@ -0,0 +1 @@
../../../../dart_filament/native/web/build/build/out/dart_filament.wasm

View File

@@ -1,4 +0,0 @@
// This file is no longer used by emscripten and has been created as a placeholder
// to allow build systems to transition away from depending on it.
//
// Future versions of emscripten will likely stop generating this file at all.

View File

@@ -0,0 +1 @@
../../../../dart_filament/native/web/build/build/out/dart_filament.worker.js

View File

@@ -64,7 +64,6 @@
</head>
<script type="module">
let dartFilamentResolveCallback = (cb, data) => {
console.log("Resolving callback");
const fn = window.df.wasmTable.get(cb);
if(data) {
fn(data);
@@ -73,7 +72,6 @@
}
}
window.createVoidCallback = () => {
console.log("CREATING VOID CALLBACK IN JS");
let res; //placeholder for resolver callback, outside of promise
const promise = new Promise((resolve, reject) => {
res = resolve;
@@ -81,7 +79,6 @@
try {
const callback = () => {
try {
console.log("INVOKING CALLBACK");
res(0);
} catch(err) {
console.log(err);
@@ -94,51 +91,8 @@
return null;
}
}
window.createIntCallback = () => {
let res;
const promise = new Promise((resolve, reject) => {
res = resolve;
});
try {
const callback = (val) => {
try {
res(val);
} catch(err) {
console.log(err);
}
}
const fnPtr = window.df.addFunction(callback, 'vi');
return [promise, fnPtr];
} catch(err) {
console.log(err);
return null;
}
}
window.createVoidPointerCallback = () => {
window.createIntCallback = window.createVoidPointerCallback = window.createBoolCallback = () => {
let res; //placeholder for resolver callback, outside of promise
const promise = new Promise((resolve, reject) => {
res = resolve;
});
try {
const callback = (voidPtr) => {
try {
res(voidPtr);
} catch(err) {
console.log(err);
}
}
const fnPtr = window.df.addFunction(callback, 'vi');
return [promise, fnPtr];
} catch(err) {
console.log(err);
return null;
}
}
window.createBoolCallback = () => {
let res; //placeholder for resolver callback, outside of promise
const promise = new Promise((resolve, reject) => {
res = resolve;
});

View File

@@ -161,7 +161,7 @@ _12790: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12790(f,x0,x1)),
_12791: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12791(f,x0,x1)),
_12792: f => finalizeWrapper(f,x0 => dartInstance.exports._12792(f,x0)),
_12793: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12793(f,x0,x1)),
_12794: f => finalizeWrapper(f,(x0,x1,x2,x3) => dartInstance.exports._12794(f,x0,x1,x2,x3)),
_12794: f => finalizeWrapper(f,(x0,x1,x2,x3,x4) => dartInstance.exports._12794(f,x0,x1,x2,x3,x4)),
_12795: f => finalizeWrapper(f,x0 => dartInstance.exports._12795(f,x0)),
_12796: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12796(f,x0,x1)),
_12797: f => finalizeWrapper(f,x0 => dartInstance.exports._12797(f,x0)),
@@ -251,7 +251,6 @@ _12931: Function.prototype.call.bind(DataView.prototype.getInt16),
_12933: Function.prototype.call.bind(DataView.prototype.getUint32),
_12935: Function.prototype.call.bind(DataView.prototype.getInt32),
_12941: Function.prototype.call.bind(DataView.prototype.getFloat32),
_12942: Function.prototype.call.bind(DataView.prototype.setFloat32),
_12943: Function.prototype.call.bind(DataView.prototype.getFloat64),
_12962: (x0,x1,x2) => x0[x1] = x2,
_12964: o => o === undefined,