Skip to content

Commit

Permalink
Merge pull request mrdoob#17980 from FMS-Cat/typedef-webglgeometries
Browse files Browse the repository at this point in the history
Update typedef for WebGLGeometries and others
  • Loading branch information
mrdoob authored Nov 22, 2019
2 parents 29c0d6c + 8aad9dc commit c8457c4
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
14 changes: 11 additions & 3 deletions src/renderers/webgl/WebGLAttributes.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
import { BufferAttribute } from "../../core/BufferAttribute";
import { InterleavedBufferAttribute } from "../../core/InterleavedBufferAttribute";

export class WebGLAttributes {

constructor( gl: WebGLRenderingContext | WebGL2RenderingContext );

get( attribute: any ): any;
get( attribute: BufferAttribute | InterleavedBufferAttribute ): {
buffer: WebGLBuffer,
type: GLenum,
bytesPerElement: number,
version: number
};

remove( attribute: any ): void;
remove( attribute: BufferAttribute | InterleavedBufferAttribute ): void;

update( attribute: any, bufferType: Array<any> ): void;
update( attribute: BufferAttribute | InterleavedBufferAttribute, bufferType: GLenum ): void;

}
15 changes: 11 additions & 4 deletions src/renderers/webgl/WebGLGeometries.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import { WebGLAttributes } from './WebGLAttributes';
import { WebGLInfo } from './WebGLInfo';
import { BufferAttribute } from '../../core/BufferAttribute';
import { BufferGeometry } from '../../core/BufferGeometry';
import { Geometry } from '../../core/Geometry';
import { Object3D } from '../../core/Object3D';

export class WebGLGeometries {

constructor( gl: WebGLRenderingContext, attributes: any, info: any );
constructor( gl: WebGLRenderingContext, attributes: WebGLAttributes, info: WebGLInfo );

get( object: any, geometry: any ): any;
update( geometry: any ): any;
getWireframeAttribute( geometry: any ): any;
get( object: Object3D, geometry: Geometry | BufferGeometry ): BufferGeometry;
update( geometry: Geometry | BufferGeometry ): void;
getWireframeAttribute( geometry: Geometry | BufferGeometry ): BufferAttribute;

}
2 changes: 1 addition & 1 deletion src/renderers/webgl/WebGLInfo.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class WebGLInfo {
points: number;
triangles: number;
};
update( count: any, mode: any, instanceCount: any ): void;
update( count: number, mode: GLenum, instanceCount: number ): void;
reset(): void;

}

0 comments on commit c8457c4

Please sign in to comment.