Created
October 9, 2020 14:41
-
-
Save neodigm/3241484d70be56076323d9cb679db3d8 to your computer and use it in GitHub Desktop.
Detect WebGL 2 browser support
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var isWebGL2Available = function () { // Does this browser support WebGL 2? | |
try { | |
var canvas = document.createElement('canvas') | |
return !!(window.WebGL2RenderingContext && canvas.getContext('webgl2')) | |
} catch (e) { | |
return false | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment