untitled-rhythm-game/js/libwebglcheck.js
2025-04-18 19:29:23 +08:00

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;
}
})();