hokkoo / webgl-mjs

Automatically exported from code.google.com/p/webgl-mjs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

In non-webgl enabled browsers, mgl is unusable.

GoogleCodeExporter opened this issue · comments

What steps will reproduce the problem?
1. Load webgl-mjs in Safari 5.
2. See in console that "Float32Array is undefined"

What is the expected output? What do you see instead?
I would expect a fallback to standard arrays.

What version of the product are you using? On what operating system?
Safari 5, OS X 10.6.4

Please provide any additional information below.
Obviously the tagline of this is "optimized for WebGL", so I understand if it's 
not supposed to work in a browser that doesn't support WebGL, but the docs (and 
even the code) seem to suggest that it should fall back to standard JS arrays. 
Looking at the code, line 66-69 suggests that we (the user) are supposed to 
uncomment the type of array to use? Even uncommenting the line to enable arrays 
still fails, since Float32Array is undefined.

Original issue reported on code.google.com by senofpe...@gmail.com on 19 Jun 2010 at 9:15

I also want to mention that the same issue exists on Firefox 3.6.3, but not 
Firefox 3.7a.

Original comment by senofpe...@gmail.com on 19 Jun 2010 at 9:17

A quick fix for this, replace the try/catch at line 54 with:

try { WebGLFloatArray; } catch (x) { 
    try {
        WebGLFloatArray = Float32Array; 
    } catch(x){
        WebGLFloatArray = Array;
    }

}

Original comment by senofpe...@gmail.com on 25 Jun 2010 at 2:26