lbry-desktop/ui/component/viewers/threeViewer/internal/detector.js
2019-11-11 13:27:29 -05:00

10 lines
351 B
JavaScript

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;