Skip to content

Instantly share code, notes, and snippets.

@neodigm
Created October 9, 2020 14:41
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save neodigm/3241484d70be56076323d9cb679db3d8 to your computer and use it in GitHub Desktop.
Save neodigm/3241484d70be56076323d9cb679db3d8 to your computer and use it in GitHub Desktop.
Detect WebGL 2 browser support
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