some progress
This commit is contained in:
+4
-1
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user