some progress

This commit is contained in:
veclavtlica
2026-10-07 11:21:21 +03:00
parent 14062e9d00
commit 8d502173a2
26 changed files with 705 additions and 212 deletions
+4 -1
View File
@@ -1,4 +1,5 @@
<!DOCTYPE html>
<!-- TODO: https://j9t.github.io/html-minifier-next/ -->
<html lang="en">
<head>
<meta charset="UTF-8">
@@ -16,6 +17,8 @@
const canvas = document.getElementById('canvas');
const ctx = canvas.getContext('2d');
// TODO: Throttle FPS.
async function main() {
const wasm = await WebAssembly.instantiateStreaming(fetch("player.wasm"));
const { memory, plr_draw_screen, plr_draw_get_pixel_buffer } = wasm.instance.exports;
@@ -24,7 +27,7 @@
const wasmBuffer = new Uint8ClampedArray(
memory.buffer,
bufferPtr,
640 * 480 * 4
640 * 480 * 4 // TODO: Retrieve actual values.
);
const imgData = new ImageData(wasmBuffer, 640, 480);