18 lines
575 B
JavaScript
18 lines
575 B
JavaScript
//libwebglcheck.js
|
|
|
|
(function() {
|
|
|
|
window.suppgl=false;
|
|
|
|
var cv=document.createElement("canvas");
|
|
var gl=cv.getContext("webgl")||cv.getContext("experimental-webgl");
|
|
if(gl!==null&&"WebGLRenderingContext" in window&&gl instanceof window.WebGLRenderingContext) {
|
|
console.log("libwebglcheck.js: the browser supports webgl");
|
|
window.suppgl=true;
|
|
} else {
|
|
//console.log("libwebglcheck.js: the browser does NOT support webgl");
|
|
window.loadfail("libwebglcheck.js: the browser does NOT support webgl");
|
|
return;
|
|
}
|
|
|
|
})(); |