Skip to content

Commit f30ec76

Browse files
Update renderWebGL to prefer the more modern WebGL2
1 parent b3cb40b commit f30ec76

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/RenderWebGL.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ class RenderWebGL extends EventEmitter {
129129
xrCompatible: true
130130
};
131131
return !!(
132-
optCanvas.getContext('webgl', options) ||
132+
optCanvas.getContext('webgl2', options) ||
133133
optCanvas.getContext('experimental-webgl', options) ||
134-
optCanvas.getContext('webgl2', options)
134+
optCanvas.getContext('webgl', options)
135135
);
136136
} catch (e) {
137137
return false;
@@ -155,8 +155,8 @@ class RenderWebGL extends EventEmitter {
155155
// getWebGLContext = try WebGL 1.0 only
156156
// getContext = try WebGL 2.0 and if that doesn't work, try WebGL 1.0
157157
// getWebGLContext || getContext = try WebGL 1.0 and if that doesn't work, try WebGL 2.0
158-
return twgl.getWebGLContext(canvas, contextAttribs) ||
159-
twgl.getContext(canvas, contextAttribs);
158+
return twgl.getContext(canvas, contextAttribs) ||
159+
twgl.getWebGLContext(canvas, contextAttribs);
160160
}
161161

162162
/**

0 commit comments

Comments
 (0)