update cli wasm
This commit is contained in:
@@ -12,16 +12,18 @@ const GLctx = require('gl')(100, 100, { preserveDrawingBuffer: true })
|
|||||||
const wasmBuffer = fs.readFileSync('dart_filament.wasm');
|
const wasmBuffer = fs.readFileSync('dart_filament.wasm');
|
||||||
|
|
||||||
var dartFilamentModulePromise = WebAssembly.compile(wasmBuffer);
|
var dartFilamentModulePromise = WebAssembly.compile(wasmBuffer);
|
||||||
|
let globalDf;
|
||||||
dart_filament({ctx:GLctx}).then((df) => {
|
dart_filament({
|
||||||
dartFilamentResolveCallback = (cb, data) => {
|
dartFilamentResolveCallback: (cb, data) => {
|
||||||
const fn = df.wasmTable.get(cb);
|
const fn = globalDf.wasmTable.get(cb);
|
||||||
if(data) {
|
if(data) {
|
||||||
fn(data);
|
fn(data);
|
||||||
} else {
|
} else {
|
||||||
fn();
|
fn();
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
ctx:GLctx}).then((df) => {
|
||||||
|
globalDf = df;
|
||||||
createVoidCallback = () => {
|
createVoidCallback = () => {
|
||||||
let res; //placeholder for resolver callback, outside of promise
|
let res; //placeholder for resolver callback, outside of promise
|
||||||
const promise = new Promise((resolve, reject) => {
|
const promise = new Promise((resolve, reject) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user