-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathshared.html
37 lines (35 loc) · 1016 Bytes
/
shared.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>BaseWebGPU Shared</title>
<style>
body { width: 100vw; height: 100vh; overflow: hidden;}
canvas { width: 100%; height: 100%; display:block; background-color: black;}
body, canvas { margin: 0px; border: 0px; padding: 0px; };
</style>
</head><body><script>
// =======================================
const canvas = document.createElement("canvas");
canvas.setAttribute("id", "canvas");
document.body.appendChild(canvas);
const context = canvas.getContext("2d");
// =====================================
async function main() {
console.log("main: start");
BaseWebGPU.add(2,2);
BaseWebGPU.sub(2,5);
console.log("main: end");
console.log(canvas.width, canvas.height);
};
// =====================================
</script>
{{{ SCRIPT }}}
<script>
Module.onRuntimeInitialized = () => {
BaseWebGPU.init();
main();
};
</script>
</body></html>