mirror of
https://github.com/odin-lang/Odin.git
synced 2026-01-01 10:52:19 +00:00
24 lines
857 B
HTML
24 lines
857 B
HTML
<!DOCTYPE html>
|
|
<html lang="en" style="height: 100%;">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>WGPU WASM Triangle</title>
|
|
</head>
|
|
<body id="body" style="height: 100%; padding: 0; margin: 0; overflow: hidden;">
|
|
<canvas id="wgpu-canvas"></canvas>
|
|
|
|
<script type="text/javascript" src="runtime.js"></script>
|
|
<script type="text/javascript" src="wgpu.js"></script>
|
|
<script type="text/javascript">
|
|
const mem = new WebAssembly.Memory({ initial: 2000, maximum: 65536, shared: false });
|
|
const memInterface = new odin.WasmMemoryInterface();
|
|
memInterface.setMemory(mem);
|
|
|
|
const wgpuInterface = new odin.WebGPUInterface(memInterface);
|
|
|
|
odin.runWasm("triangle.wasm", null, { wgpu: wgpuInterface.getInterface() }, memInterface, /*intSize=8*/);
|
|
</script>
|
|
</body>
|
|
</html>
|