瀏覽代碼

Merge pull request #19725 from Mugen87/dev43

TS: Add WebGLBindingStates.d.ts.
Mr.doob 5 年之前
父節點
當前提交
86ae53f8c2
共有 2 個文件被更改,包括 24 次插入3 次删除
  1. 24 0
      src/renderers/webgl/WebGLBindingStates.d.ts
  2. 0 3
      src/renderers/webgl/WebGLBindingStates.js

+ 24 - 0
src/renderers/webgl/WebGLBindingStates.d.ts

@@ -0,0 +1,24 @@
+import { WebGLExtensions } from './WebGLExtensions';
+import { WebGLAttributes } from './WebGLAttributes';
+import { WebGLProgram } from './WebGLProgram';
+import { WebGLCapabilities } from './WebGLCapabilities';
+import { Object3D } from './../../core/Object3D';
+import { BufferGeometry } from './../../core/BufferGeometry';
+import { BufferAttribute } from './../../core/BufferAttribute';
+import { Material } from './../../materials/Material';
+
+export class WebGLBindingStates {
+
+	constructor( gl: WebGLRenderingContext, extensions: WebGLExtensions, attributes: WebGLAttributes, capabilities: WebGLCapabilities );
+
+	setup( object: Object3D, material: Material, program: WebGLProgram, geometry: BufferGeometry, index: BufferAttribute ): void;
+	reset(): void;
+	resetDefaultState(): void;
+	dispose(): void;
+	releaseStatesOfGeometry(): void;
+	releaseStatesOfProgram(): void;
+	initAttributes(): void;
+	enableAttribute( attribute: number ): void;
+	disableUnusedAttributes(): void;
+
+}

+ 0 - 3
src/renderers/webgl/WebGLBindingStates.js

@@ -168,9 +168,6 @@ function WebGLBindingStates( gl, extensions, attributes, capabilities ) {
 
 	}
 
-	// If we sacrifice some BufferGeometry/Attribute API flexibility
-	// needsUpdate() and saveCache() can be much simpler. See #16287
-
 	function needsUpdate( geometry ) {
 
 		const cachedAttributes = currentState.attributes;