adds missing setPixels() method

This commit is contained in:
Mathias Paumgarten
2018-05-17 12:18:01 +02:00
parent 131650c616
commit db5c8936d5
2 changed files with 12 additions and 2 deletions

View File

@@ -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;

View File

@@ -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;