mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-04 19:42:46 +08:00
adds missing setPixels() method
This commit is contained in:
@@ -54,11 +54,20 @@ texture2d(gl, ndarray([1, 2, 3]));
|
||||
|
||||
const texture = texture2d(gl, canvas);
|
||||
|
||||
texture.bind();
|
||||
texture.bind(1);
|
||||
texture.dispose();
|
||||
texture.generateMipmap();
|
||||
|
||||
texture.bind();
|
||||
texture.bind(1);
|
||||
|
||||
texture.setPixels(canvas);
|
||||
texture.setPixels(video);
|
||||
texture.setPixels(image);
|
||||
texture.setPixels(imageData);
|
||||
texture.setPixels(ndarray([1, 2, 3]));
|
||||
texture.setPixels(canvas, [1,1]);
|
||||
texture.setPixels(canvas, [1,1], 0);
|
||||
|
||||
texture.magFilter = 1;
|
||||
texture.minFilter = 1;
|
||||
texture.mipSamples = 1;
|
||||
|
||||
1
types/gl-texture2d/index.d.ts
vendored
1
types/gl-texture2d/index.d.ts
vendored
@@ -29,6 +29,7 @@ declare class Texture {
|
||||
bind(id?: number): number;
|
||||
dispose(): void;
|
||||
generateMipmap(): void;
|
||||
setPixels( data: InputType | RawObject | ndarray, offset?: [number, number], mipLevel?: GLenum): void;
|
||||
}
|
||||
|
||||
declare function texture2d(gl: WebGLRenderingContext, array: ndarray): Texture;
|
||||
|
||||
Reference in New Issue
Block a user