mirror of
https://github.com/scratchfoundation/scratch-render.git
synced 2025-05-15 07:50:41 -04:00
try WebGL 2.0 if WebGL 1.0 fails
This commit is contained in:
parent
156980980f
commit
0f6663f314
1 changed files with 6 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue