/** * additional import for TypeScript * @import {TextureAtlas} from "./../../texture/atlas.js"; */ /** * Base class for batchers that manage WebGL textures and material properties. * Provides texture creation, binding, uploading, and deletion. * @category Rendering */ export class MaterialBatcher extends Batcher { /** * the current active texture unit * @ignore */ currentTextureUnit: any; /** * bound textures by unit * @ignore */ boundTextures: any[] | undefined; /** * Create a WebGL texture from an image * @param {number} unit - Destination texture unit * @param {Image|HTMLCanvasElement|ImageData|Uint8Array[]|Float32Array[]} [pixels=null] - Source image * @param {number} filter - gl.LINEAR or gl.NEAREST * @param {string} [repeat="no-repeat"] - Image repeat behavior * @param {number} [w=pixels.width] - Source image width * @param {number} [h=pixels.height] - Source image height * @param {boolean} [premultipliedAlpha=true] - Multiplies the alpha channel into the other color channels * @param {boolean} [mipmap=true] - Whether mipmap levels should be generated * @returns {WebGLTexture} a WebGL texture */ createTexture2D(unit: number, pixels?: (new (width?: number, height?: number) => HTMLImageElement) | HTMLCanvasElement | ImageData | Uint8Array[] | Float32Array[], filter: number, repeat?: string, w?: number, h?: number, premultipliedAlpha?: boolean, mipmap?: boolean, texture: any, flush?: boolean): WebGLTexture; /** * delete the given WebGL texture * @param {WebGLTexture|TextureAtlas} texture - a WebGL texture or TextureAtlas to delete */ deleteTexture2D(texture: WebGLTexture | TextureAtlas): void; /** * returns the WebGL texture associated to the given texture unit * @param {number} unit - Texture unit to which a texture is bound * @returns {WebGLTexture} texture a WebGL texture */ getTexture2D(unit: number): WebGLTexture; /** * assign the given WebGL texture to the current batch * @param {WebGLTexture} texture - a WebGL texture * @param {number} unit - Texture unit to which the given texture is bound */ bindTexture2D(texture: WebGLTexture, unit: number, flush?: boolean): void; /** * unbind the given WebGL texture, forcing it to be reuploaded * @param {WebGLTexture} [texture] - a WebGL texture * @param {number} [unit] - Texture unit to unbind from * @returns {number} unit the unit number that was associated with the given texture */ unbindTexture2D(texture?: WebGLTexture, unit?: number): number; /** * @ignore */ uploadTexture(texture: any, w: any, h: any, force?: boolean, flush?: boolean): any; } import { Batcher } from "./batcher.js"; import type { TextureAtlas } from "./../../texture/atlas.js"; //# sourceMappingURL=material_batcher.d.ts.map