-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
I recently came across a situation where a PC did not have support for webgl (either webgl wasn't enabled in the browser, or the PC didn't have a graphics card that supports webgl).
Rather than seeing a big red error that makes it look like the codebase has errors, we should do a check for webgl support, and only continue if webgl is supported. If it's not, show a message indicating that webgl support is required for this project to function correctly.
Example check for WebGL support:
// Get WebGLRenderingContext from canvas element.
const gl =
canvas.getContext("webgl") || canvas.getContext("experimental-webgl");
// Report the result.
const webglSupportMessage =
gl instanceof WebGLRenderingContext
? "Congratulations! Your browser supports WebGL."
: "Failed. Your browser or device may not support WebGL.";Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request