lbry-desktop/ui/component/viewers/threeViewer/internal/detector.js

11 lines
351 B
JavaScript
Raw Permalink Normal View History

2018-06-06 08:06:03 +02:00
const detectWebGL = () => {
// Create canvas element.
const canvas = document.createElement('canvas');
// Get WebGLRenderingContext from canvas element.
const gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
// Return the result.
return gl && gl instanceof WebGLRenderingContext;
};
export default detectWebGL;