Explorar o código

Examples: Avoid usage of raw WebGL context

Mugen87 %!s(int64=6) %!d(string=hai) anos
pai
achega
206ba2e3b1
Modificáronse 1 ficheiros con 2 adicións e 4 borrados
  1. 2 4
      examples/webgl_lights_rectarealight.html

+ 2 - 4
examples/webgl_lights_rectarealight.html

@@ -77,19 +77,17 @@
 				renderer.gammaOutput = true;
 				document.body.appendChild( renderer.domElement );
 
-				var gl = renderer.context;
-
 				// Check for float-RT support
 				// TODO (abelnation): figure out fall-back for float textures
 
-				if ( ! gl.getExtension( 'OES_texture_float' ) ) {
+				if ( ! renderer.extensions.get( 'OES_texture_float' ) ) {
 
 					alert( 'OES_texture_float not supported' );
 					throw 'missing webgl extension';
 
 				}
 
-				if ( ! gl.getExtension( 'OES_texture_float_linear' ) ) {
+				if ( ! renderer.extensions.get( 'OES_texture_float_linear' ) ) {
 
 					alert( 'OES_texture_float_linear not supported' );
 					throw 'missing webgl extension';