UNPKG

1.51 kBTypeScriptView Raw
1import { Resource } from './Resource';
2import type { ISize } from '@pixi/math';
3import type { BaseTexture } from '../BaseTexture';
4import type { Renderer } from '../../Renderer';
5import type { GLTexture } from '../GLTexture';
6/**
7 * @interface SharedArrayBuffer
8 */
9/**
10 * Buffer resource with data of typed array.
11 * @memberof PIXI
12 */
13export declare class BufferResource extends Resource {
14 /** Source array Cannot be {@code ClampedUint8Array} because it cant be uploaded to WebGL */
15 data: Float32Array | Uint8Array | Uint16Array | Int32Array | Uint32Array;
16 /**
17 * @param source - Source buffer
18 * @param options - Options
19 * @param {number} options.width - Width of the texture
20 * @param {number} options.height - Height of the texture
21 */
22 constructor(source: Float32Array | Uint8Array | Uint16Array | Int32Array | Uint32Array, options: ISize);
23 /**
24 * Upload the texture to the GPU.
25 * @param renderer - Upload to the renderer
26 * @param baseTexture - Reference to parent texture
27 * @param glTexture - glTexture
28 * @returns - true is success
29 */
30 upload(renderer: Renderer, baseTexture: BaseTexture, glTexture: GLTexture): boolean;
31 /** Destroy and don't use after this. */
32 dispose(): void;
33 /**
34 * Used to auto-detect the type of resource.
35 * @param {*} source - The source object
36 * @returns {boolean} `true` if <canvas>
37 */
38 static test(source: unknown): source is Float32Array | Uint8Array | Uint32Array;
39}