wgpu-renderer/index.html

50 lines
1.1 KiB
HTML
Raw Normal View History

2023-01-27 23:16:57 +02:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>wgpu-renderer</title>
<style>
2023-11-05 00:16:34 +02:00
body {
margin: 0;
padding: 0;
background: black;
}
2023-11-05 02:27:38 +02:00
2023-01-27 23:16:57 +02:00
canvas {
background-color: black;
2023-11-04 22:37:01 +02:00
display: block;
2023-11-05 00:16:34 +02:00
width: 100vw;
height: 100vh;
2023-11-04 22:37:01 +02:00
}
2023-11-05 02:27:38 +02:00
2023-11-04 22:37:01 +02:00
#loading {
color: white;
position: absolute;
top: 50%;
right: 50%;
z-index: 100;
2023-01-27 23:16:57 +02:00
}
</style>
</head>
2023-11-05 00:16:34 +02:00
<body>
2023-11-05 02:27:38 +02:00
<h1 id="loading">Loading...</h1>
<script type="module">
import init from "./pkg/wgpu_renderer.js";
// TODO: still on GL, uncomment once WebGPU works
// if (!navigator.gpu) {
// document.getElementById("loading").innerText = "WebGPU not supported :(";
// } else {
2023-01-27 23:16:57 +02:00
init().then(() => {
console.log("WASM Loaded");
2023-11-05 02:27:38 +02:00
document.getElementById("loading").remove();
2023-01-27 23:16:57 +02:00
});
2023-11-05 02:27:38 +02:00
// }
</script>
2023-01-27 23:16:57 +02:00
</body>
</html>