chore: pointer lock

This commit is contained in:
stitchy 2024-12-18 07:36:41 +00:00
parent de87bd233a
commit f6c2f2d3d7
Signed by: stitchy
SSH key fingerprint: SHA256:yz2SoxdnY67tfY5Jzb0f2v8f5W3o/IF359kbcquWip8

View file

@ -170,5 +170,10 @@ document.addEventListener("keydown", function (event) {
document.addEventListener("keyup", function (event) {
keymap.set(event.key, false);
});
// Request pointer Lock
canvas.addEventListener("click", async () => {
await canvas.requestPointerLock();
});
// Update loop
draw(gl, program);