File tree Expand file tree Collapse file tree 1 file changed +27
-21
lines changed
examples/jsm/capabilities Expand file tree Collapse file tree 1 file changed +27
-21
lines changed Original file line number Diff line number Diff line change 11class WebGL {
22
3- static isWebGLAvailable ( ) {
4-
5- try {
6-
7- const canvas = document . createElement ( 'canvas' ) ;
8- return ! ! ( window . WebGLRenderingContext && ( canvas . getContext ( 'webgl' ) || canvas . getContext ( 'experimental-webgl' ) ) ) ;
9-
10- } catch ( e ) {
11-
12- return false ;
13-
14- }
15-
16- }
17-
183 static isWebGL2Available ( ) {
194
205 try {
@@ -47,12 +32,6 @@ class WebGL {
4732
4833 }
4934
50- static getWebGLErrorMessage ( ) {
51-
52- return this . getErrorMessage ( 1 ) ;
53-
54- }
55-
5635 static getWebGL2ErrorMessage ( ) {
5736
5837 return this . getErrorMessage ( 2 ) ;
@@ -103,6 +82,33 @@ class WebGL {
10382
10483 }
10584
85+ // @deprecated , r168
86+
87+ static isWebGLAvailable ( ) {
88+
89+ console . warn ( 'isWebGLAvailable() has been deprecated and will be removed in r178. Use isWebGL2Available() instead.' ) ;
90+
91+ try {
92+
93+ const canvas = document . createElement ( 'canvas' ) ;
94+ return ! ! ( window . WebGLRenderingContext && ( canvas . getContext ( 'webgl' ) || canvas . getContext ( 'experimental-webgl' ) ) ) ;
95+
96+ } catch ( e ) {
97+
98+ return false ;
99+
100+ }
101+
102+ }
103+
104+ static getWebGLErrorMessage ( ) {
105+
106+ console . warn ( 'getWebGLErrorMessage() has been deprecated and will be removed in r178. Use getWebGL2ErrorMessage() instead.' ) ;
107+
108+ return this . getErrorMessage ( 1 ) ;
109+
110+ }
111+
106112}
107113
108114export default WebGL ;
You can’t perform that action at this time.
0 commit comments