1 | import { Resource } from './Resource';
|
2 | import type { ISize } from '@pixi/math';
|
3 | import type { Renderer } from '../../Renderer';
|
4 | import type { BaseTexture } from '../BaseTexture';
|
5 | import type { GLTexture } from '../GLTexture';
|
6 | export type BufferType = null | Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array;
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | export interface IBufferResourceOptions extends ISize {
|
12 | unpackAlignment?: 1 | 2 | 4 | 8;
|
13 | }
|
14 |
|
15 |
|
16 |
|
17 |
|
18 | export declare class BufferResource extends Resource {
|
19 |
|
20 | data: BufferType;
|
21 |
|
22 | unpackAlignment: 1 | 2 | 4 | 8;
|
23 | |
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 | constructor(source: BufferType, options: IBufferResourceOptions);
|
31 | /**
|
32 | * Upload the texture to the GPU.
|
33 | * @param renderer - Upload to the renderer
|
34 | * @param baseTexture - Reference to parent texture
|
35 | * @param glTexture - glTexture
|
36 | * @returns - true is success
|
37 | */
|
38 | upload(renderer: Renderer, baseTexture: BaseTexture, glTexture: GLTexture): boolean;
|
39 | /** Destroy and don't use after this. */
|
40 | dispose(): void;
|
41 | /**
|
42 | * Used to auto-detect the type of resource.
|
43 | * @param {*} source - The source object
|
44 | * @returns {boolean} `true` if buffer source
|
45 | */
|
46 | static test(source: unknown): source is BufferType;
|
47 | }
|