diff options
| author | Raymaekers Luca <luca@spacehb.net> | 2025-10-10 11:29:09 +0200 |
|---|---|---|
| committer | Raymaekers Luca <luca@spacehb.net> | 2025-10-10 11:29:09 +0200 |
| commit | 7cb810089144d42d202e0b267235174d7869c5aa (patch) | |
| tree | 579008fbb822bc78412e3604909e94a4711cfeaf /code/platform.js | |
| parent | 732e6a47ded496cd224e1cfadc2106b04dcf6859 (diff) | |
checkpoint
Diffstat (limited to 'code/platform.js')
| -rw-r--r-- | code/platform.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/code/platform.js b/code/platform.js index 163b0ad..7790297 100644 --- a/code/platform.js +++ b/code/platform.js @@ -46,6 +46,15 @@ async function main() var messageJS = ReadHeapString(message, length); console.log(messageJS); }, + floor: Math.floor, + ceil: Math.ceil, + sqrt: Math.sqrt, + pow: Math.pow, + fmod: Math.fround, // Note: JavaScript doesn't have a native fmod function, so we use fround as a close approximation + cos: Math.cos, + acos: Math.acos, + fabs: Math.abs, // Note: JavaScript doesn't have a native fabs function, so we use abs as a close approximation + round: Math.round, }; const { instance } = await WebAssembly.instantiateStreaming( @@ -63,7 +72,7 @@ async function main() canvas.width = width; canvas.height = height; - const buffer_address = instance.exports.Buffer.value; + const buffer_address = instance.exports.GlobalImageBuffer.value; const image = new ImageData( new Uint8ClampedArray(instance.exports.memory.buffer, buffer_address, |
