style: add eslint and prettier
This commit is contained in:
@ -1,18 +1,22 @@
|
||||
export function checkWebGL() {
|
||||
if(window.WebGLRenderingContext) {
|
||||
if (window.WebGLRenderingContext) {
|
||||
const canvas = document.createElement("canvas");
|
||||
try {
|
||||
const ctx = canvas.getContext("webgl2") || canvas.getContext("webgl");
|
||||
if(ctx && typeof ctx.getParameter == "function") {
|
||||
if (ctx && typeof ctx.getParameter == "function") {
|
||||
return true;
|
||||
}
|
||||
} catch(e) {
|
||||
} catch (_e) {
|
||||
// Supported, but disabled
|
||||
alert("WebGL is supported but disabled in your browser. Please enable it in your settings.")
|
||||
alert(
|
||||
"WebGL is supported but disabled in your browser. Please enable it in your settings.",
|
||||
);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
// WebGL is not supported
|
||||
alert("WebGL is not supported in your browser. Please try a different browser.");
|
||||
alert(
|
||||
"WebGL is not supported in your browser. Please try a different browser.",
|
||||
);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user