1 | import { GLBuffer } from './GLBuffer';
|
2 | import type { BUFFER_TYPE } from '@pixi/constants';
|
3 | import type { ExtensionMetadata } from '@pixi/extensions';
|
4 | import type { IRenderingContext } from '../IRenderer';
|
5 | import type { Renderer } from '../Renderer';
|
6 | import type { ISystem } from '../system/ISystem';
|
7 | import type { Buffer } from './Buffer';
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 | export declare class BufferSystem implements ISystem {
|
26 |
|
27 | static extension: ExtensionMetadata;
|
28 | CONTEXT_UID: number;
|
29 | gl: IRenderingContext;
|
30 |
|
31 | readonly managedBuffers: {
|
32 | [key: number]: Buffer;
|
33 | };
|
34 |
|
35 | readonly boundBufferBases: {
|
36 | [key: number]: Buffer;
|
37 | };
|
38 | private renderer;
|
39 | |
40 |
|
41 |
|
42 | constructor(renderer: Renderer);
|
43 | /**
|
44 | * @ignore
|
45 | */
|
46 | destroy(): void;
|
47 | /** Sets up the renderer context and necessary buffers. */
|
48 | protected contextChange(): void;
|
49 | /**
|
50 | * This binds specified buffer. On first run, it will create the webGL buffers for the context too
|
51 | * @param buffer - the buffer to bind to the renderer
|
52 | */
|
53 | bind(buffer: Buffer): void;
|
54 | unbind(type: BUFFER_TYPE): void;
|
55 | /**
|
56 | * Binds an uniform buffer to at the given index.
|
57 | *
|
58 | * A cache is used so a buffer will not be bound again if already bound.
|
59 | * @param buffer - the buffer to bind
|
60 | * @param index - the base index to bind it to.
|
61 | */
|
62 | bindBufferBase(buffer: Buffer, index: number): void;
|
63 | /**
|
64 | * Binds a buffer whilst also binding its range.
|
65 | * This will make the buffer start from the offset supplied rather than 0 when it is read.
|
66 | * @param buffer - the buffer to bind
|
67 | * @param index - the base index to bind at, defaults to 0
|
68 | * @param offset - the offset to bind at (this is blocks of 256). 0 = 0, 1 = 256, 2 = 512 etc
|
69 | */
|
70 | bindBufferRange(buffer: Buffer, index?: number, offset?: number): void;
|
71 | /**
|
72 | * Will ensure the data in the buffer is uploaded to the GPU.
|
73 | * @param {PIXI.Buffer} buffer - the buffer to update
|
74 | */
|
75 | update(buffer: Buffer): void;
|
76 | |
77 |
|
78 |
|
79 |
|
80 |
|
81 | dispose(buffer: Buffer, contextLost?: boolean): void;
|
82 | |
83 |
|
84 |
|
85 |
|
86 | disposeAll(contextLost?: boolean): void;
|
87 | |
88 |
|
89 |
|
90 |
|
91 |
|
92 | protected createGLBuffer(buffer: Buffer): GLBuffer;
|
93 | }
|