Browse Source

Added deprecated .uniforms and attributes*.

tschw 10 years ago
parent
commit
a2a6a9d5d6
1 changed files with 34 additions and 1 deletions
  1. 34 1
      src/renderers/webgl/WebGLProgram.js

+ 34 - 1
src/renderers/webgl/WebGLProgram.js

@@ -406,7 +406,7 @@ THREE.WebGLProgram = ( function () {
 
 
 		};
 		};
 
 
-		// set up caching for attribute keys and locations
+		// set up caching for attribute locations
 
 
 		var getAttributes = function() { return this._cachedAttributes; };
 		var getAttributes = function() { return this._cachedAttributes; };
 
 
@@ -419,6 +419,39 @@ THREE.WebGLProgram = ( function () {
 
 
 		};
 		};
 
 
+		// DEPRECATED
+
+		Object.defineProperties( this, {
+
+			uniforms: {
+				get: function() {
+
+					console.warn( 'THREE.WebGLProgram: .uniforms is now .getUniforms().' );
+					return this.getUniforms();
+
+				}
+			},
+
+			attributes: {
+				get: function() {
+
+					console.warn( 'THREE.WebGLProgram: .attributes is now .getAttributes().' );
+					return this.getAttributes();
+
+				}
+			},
+
+			attributesKeys: {
+				get: function() {
+
+					console.warn( 'THREE.WebGLProgram: .attributesKeys has been removed.' );
+					return Object.keys( this.getAttributes() );
+
+				}
+			}
+		});
+
+
 		//
 		//
 
 
 		this.id = programIdCount ++;
 		this.id = programIdCount ++;