Skip to content

Commit

Permalink
Update script.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Leroks committed Dec 17, 2023
1 parent e6c8ff7 commit 80a4bea
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ function initShaderProgram(gl, vsSource, fsSource) {
window.requestAnimFrame = (function () {
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function (callback) {
Expand Down Expand Up @@ -156,9 +155,7 @@ var render = function () {

var pointerLockApi = function () {
return canvas ===
document.pointerLockElement ||
canvas ===
document.mozPointerLockElement;
document.pointerLockElement
}

function init() {
Expand All @@ -170,11 +167,10 @@ function init() {
gl.useProgram(program);

var havePointerLock = 'pointerLockElement' in document ||
'mozPointerLockElement' in document ||
'webkitPointerLockElement' in document;

canvas.requestPointerLock = canvas.requestPointerLock || canvas.mozRequestPointerLock;
document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock;
canvas.requestPointerLock = canvas.requestPointerLock;
document.exitPointerLock = document.exitPointerLock;


var lockChange = function () {
Expand All @@ -191,7 +187,6 @@ function init() {

document.addEventListener('pointerlockchange', lockChange, false);


moveCallback = function (e) {
isMouse = true;
var movementX = e.movementX ||
Expand Down

0 comments on commit 80a4bea

Please sign in to comment.