/** * A WebGL Index Buffer object. * Can be used for static patterns (e.g. quad indices) or dynamic indexed drawing. * @ignore */ export default class IndexBuffer { /** * @param {WebGLRenderingContext|WebGL2RenderingContext} gl - the WebGL context * @param {number} maxIndices - maximum number of indices this buffer can hold * @param {boolean} [useUint32=false] - use Uint32 indices (WebGL2) instead of Uint16 (WebGL1) * @param {boolean} [dynamic=false] - if true, use STREAM_DRAW for frequent updates; if false, use STATIC_DRAW */ constructor(gl: WebGLRenderingContext | WebGL2RenderingContext, maxIndices: number, useUint32?: boolean, dynamic?: boolean); gl: WebGLRenderingContext | WebGL2RenderingContext; dynamic: boolean; type: 5123 | 5125; data: Uint16Array | Uint32Array; /** * the current number of indices in the buffer * @type {number} */ length: number; buffer: WebGLBuffer; /** * Fill the buffer with a repeating quad index pattern [0,1,2, 2,1,3, 4,5,6, ...] * and upload as a static buffer. * @param {number} maxQuads - number of quads to generate indices for */ fillQuadPattern(maxQuads: number): void; /** * Reset the index count (for dynamic buffers) */ clear(): void; /** * Add indices to the buffer, rebased by the given vertex offset * @param {number[]} indices - source indices to add * @param {number} vertexOffset - value to add to each index (vertex count at time of insertion) */ add(indices: number[], vertexOffset: number): void; /** * Add pre-computed absolute indices to the buffer (no rebasing) * @param {number[]} indices - absolute index values to add */ addRaw(indices: number[]): void; /** * Upload the current index data to the GPU (for dynamic buffers) */ upload(): void; /** * bind this index buffer */ bind(): void; } //# sourceMappingURL=index.d.ts.map