chore: pointer lock
This commit is contained in:
parent
de87bd233a
commit
f6c2f2d3d7
1 changed files with 5 additions and 0 deletions
|
@ -170,5 +170,10 @@ document.addEventListener("keydown", function (event) {
|
||||||
document.addEventListener("keyup", function (event) {
|
document.addEventListener("keyup", function (event) {
|
||||||
keymap.set(event.key, false);
|
keymap.set(event.key, false);
|
||||||
});
|
});
|
||||||
|
// Request pointer Lock
|
||||||
|
canvas.addEventListener("click", async () => {
|
||||||
|
await canvas.requestPointerLock();
|
||||||
|
});
|
||||||
|
|
||||||
// Update loop
|
// Update loop
|
||||||
draw(gl, program);
|
draw(gl, program);
|
||||||
|
|
Loading…
Reference in a new issue