diff --git a/src/RenderWebGL.js b/src/RenderWebGL.js index d3694cc8..c65e6747 100644 --- a/src/RenderWebGL.js +++ b/src/RenderWebGL.js @@ -111,7 +111,12 @@ class RenderWebGL extends EventEmitter { * @private */ static _getContext (canvas) { - return twgl.getWebGLContext(canvas, {alpha: false, stencil: true, antialias: false}); + const contextAttribs = {alpha: false, stencil: true, antialias: false}; + // getWebGLContext = try WebGL 1.0 only + // getContext = try WebGL 2.0 and if that doesn't work, try WebGL 1.0 + // getWebGLContext || getContext = try WebGL 1.0 and if that doesn't work, try WebGL 2.0 + return twgl.getWebGLContext(canvas, contextAttribs) || + twgl.getContext(canvas, contextAttribs); } /**