@predy-js/render-interface 0.1.30-beta.4 → 0.1.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/dist/statistic.js +1 -1
- package/dist/types/native/GeometryInternal.d.ts +17 -11
- package/package.json +1 -1
package/dist/statistic.js
CHANGED
@@ -1,15 +1,11 @@
|
|
1
1
|
import type { AttributeWithType, GeometryOptions } from '../Geometry';
|
2
2
|
import type { ResourceInternal, ResourcePlatform } from './ResourceInternal';
|
3
|
-
import type { AttributeBase } from '../Geometry';
|
4
3
|
import type { GPUBufferInternal } from './GPUBufferInternal';
|
5
|
-
interface
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
attr: AttributeWithBuffer | AttributeWithType;
|
11
|
-
name: string;
|
12
|
-
}[];
|
4
|
+
export interface GeometryInternalOptions extends Omit<GeometryOptions, 'attributes' | 'index'> {
|
5
|
+
attributes: AttributeWithType[];
|
6
|
+
buffers: Record<string, GPUBufferInternal>;
|
7
|
+
index?: GPUBufferInternal;
|
8
|
+
indexType?: IndexBufferType;
|
13
9
|
}
|
14
10
|
export type IndexBufferType = WebGLRenderingContext['UNSIGNED_SHORT'] | WebGLRenderingContext['UNSIGNED_INT'];
|
15
11
|
/**
|
@@ -18,13 +14,23 @@ export type IndexBufferType = WebGLRenderingContext['UNSIGNED_SHORT'] | WebGLRen
|
|
18
14
|
export declare abstract class GeometryInternal implements ResourceInternal {
|
19
15
|
readonly isDestroyed: boolean;
|
20
16
|
readonly platform: ResourcePlatform;
|
17
|
+
name: string;
|
21
18
|
drawStart: number;
|
22
19
|
drawCount: number;
|
23
20
|
mode: GLenum;
|
24
21
|
protected constructor(options: GeometryInternalOptions);
|
25
22
|
abstract setAttributeBuffer(name: string, buffer: GPUBufferInternal | undefined): void;
|
26
23
|
abstract getAttributeBuffer(name: string): GPUBufferInternal | undefined;
|
27
|
-
abstract
|
24
|
+
abstract getIndexBuffer(): [buffer: GPUBufferInternal | undefined, type: number];
|
25
|
+
/**
|
26
|
+
* 获得当前所有的attributeBuffer
|
27
|
+
*/
|
28
|
+
abstract getAttributeBufferMap(): Record<string, GPUBufferInternal>;
|
29
|
+
abstract setIndexBuffer(buffer: GPUBufferInternal | undefined, bufferType?: IndexBufferType): void;
|
30
|
+
/**
|
31
|
+
* 并不会销毁attributeBuffers和IndexBuffer,
|
32
|
+
* 但会清除内部buffer的引用,如果需要销毁buffers,
|
33
|
+
* 调用destroy之前,需要手动调用 getAttributeBufferMap 和 getIndexBuffer 将获得的buffer显式销毁
|
34
|
+
*/
|
28
35
|
abstract destroy(): void;
|
29
36
|
}
|
30
|
-
export {};
|