-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.js
More file actions
32 lines (27 loc) · 1.04 KB
/
index.js
File metadata and controls
32 lines (27 loc) · 1.04 KB
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
import init, {webmain} from "./pkg/WGPU.js";
init().then(() => {
webmain();
}
).catch((error) => {
if (!error.message.startsWith("Using exceptions for control flow,")) {
throw error;
}
});
window.onload = function(){
// console.log(window.devicePixelRatio)
window.innerWidth = window.devicePixelRatio*document.documentElement.clientWidth;
window.innerHeight = window.devicePixelRatio*document.documentElement.clientHeight;
}
window.onresize = function() {
let WGPUWindow = document.getElementById("winit");
// document.body.style.zoom=1/window.devicePixelRatio;
// console.log(window.devicePixelRatio)
window.innerWidth = window.devicePixelRatio*document.documentElement.clientWidth;
window.innerHeight = window.devicePixelRatio*document.documentElement.clientHeight;
// WGPUWindow.requestFullscreen();
// // WGPUWindow.exitFullscreen();
// console.log("resize")
// WGPUWindow.width = window.innerWidth;
// WGPUWindow.height = window.innerHeight;
// WGPUWindow.style = " "
}