evanw / evanw/lightgl.js

Mouse down not working in Chrome 24.0.1312.57

Open
#11 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.6k
Forks
149
PR merge metrics
No merged PRs in 30d

Description

This could be a bug with chrome... I'm not sure because it's really weird.
I think chrome 24.0.1312.57 is garbage collecting your canvas reference or something. In your first person camera example, try putting a setTimeout wrapper with 1 second of delay around your gl settings block like this:

``` javascript
setTimeout(function(){
gl.fullscreen();
gl.animate();
gl.enable(gl.CULL_FACE);
gl.enable(gl.POLYGON_OFFSET_FILL);
gl.polygonOffset(1, 1);
gl.clearColor(0.8, 0.8, 0.8, 1);
gl.enable(gl.DEPTH_TEST);
}, 1000);
```

The mouse look no longer works. I'm not trying to use a setTimeout but I think my code is slow. I did some investigating and noticed that when I leaked the canvas element var to the window or to the GL object at around here:
https://github.com/evanw/lightgl.js/blob/master/src/main.js#L213
everything worked just fine again. That's why I think it's some sort of garbage collecting issue.

I love the library by the way. I just thought I'd let you know of this strange situation.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.