@galacean/engine-core 1.0.0-beta.11 → 1.0.0-beta.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/engine-core",
3
- "version": "1.0.0-beta.11",
3
+ "version": "1.0.0-beta.12",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -15,10 +15,10 @@
15
15
  "types/**/*"
16
16
  ],
17
17
  "dependencies": {
18
- "@galacean/engine-math": "1.0.0-beta.11"
18
+ "@galacean/engine-math": "1.0.0-beta.12"
19
19
  },
20
20
  "devDependencies": {
21
- "@galacean/engine-design": "1.0.0-beta.11"
21
+ "@galacean/engine-design": "1.0.0-beta.12"
22
22
  },
23
23
  "scripts": {
24
24
  "b:types": "tsc"
@@ -2,6 +2,7 @@ import { GraphicsResource } from "../asset/GraphicsResource";
2
2
  import { TextureDepthCompareFunction } from "./enums/TextureDepthCompareFunction";
3
3
  import { TextureFilterMode } from "./enums/TextureFilterMode";
4
4
  import { TextureFormat } from "./enums/TextureFormat";
5
+ import { TextureUsage } from "./enums/TextureUsage";
5
6
  import { TextureWrapMode } from "./enums/TextureWrapMode";
6
7
  /**
7
8
  * The base class of texture, contains some common functions of texture-related classes.
@@ -11,6 +12,7 @@ export declare abstract class Texture extends GraphicsResource {
11
12
  protected _format: TextureFormat;
12
13
  protected _width: number;
13
14
  protected _height: number;
15
+ protected _usage: TextureUsage;
14
16
  protected _mipmapCount: number;
15
17
  private _wrapModeU;
16
18
  private _wrapModeV;
@@ -30,6 +32,10 @@ export declare abstract class Texture extends GraphicsResource {
30
32
  * The height of the texture.
31
33
  */
32
34
  get height(): number;
35
+ /**
36
+ * The usage of the texture.
37
+ */
38
+ get usage(): TextureUsage;
33
39
  /**
34
40
  * Wrapping mode for texture coordinate S.
35
41
  */
@@ -1,5 +1,6 @@
1
1
  import { Engine } from "../Engine";
2
2
  import { TextureFormat } from "./enums/TextureFormat";
3
+ import { TextureUsage } from "./enums/TextureUsage";
3
4
  import { Texture } from "./Texture";
4
5
  /**
5
6
  * Two-dimensional texture.
@@ -12,8 +13,9 @@ export declare class Texture2D extends Texture {
12
13
  * @param height - Texture height
13
14
  * @param format - Texture format. default `TextureFormat.R8G8B8A8`
14
15
  * @param mipmap - Whether to use multi-level texture
16
+ * @param usage - Texture usage
15
17
  */
16
- constructor(engine: Engine, width: number, height: number, format?: TextureFormat, mipmap?: boolean);
18
+ constructor(engine: Engine, width: number, height: number, format?: TextureFormat, mipmap?: boolean, usage?: TextureUsage);
17
19
  /**
18
20
  * Setting pixels data through color buffer data, designated area and texture mipmapping level,it's also applicable to compressed formats.
19
21
  * @remarks If it is the WebGL1.0 platform and the texture format is compressed, the first upload must be filled with textures.
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Texture usage.
3
+ */
4
+ export declare enum TextureUsage {
5
+ /** The content of the texture is intended to be specified once. */
6
+ Static = 0,
7
+ /** The content of the texture is intended to be updated frequently, with better performance. */
8
+ Dynamic = 1
9
+ }
@@ -3,6 +3,7 @@ export { TextureCubeFace } from "./enums/TextureCubeFace";
3
3
  export { TextureDepthCompareFunction } from "./enums/TextureDepthCompareFunction";
4
4
  export { TextureFilterMode } from "./enums/TextureFilterMode";
5
5
  export { TextureFormat } from "./enums/TextureFormat";
6
+ export { TextureUsage } from "./enums/TextureUsage";
6
7
  export { TextureWrapMode } from "./enums/TextureWrapMode";
7
8
  export { RenderTarget } from "./RenderTarget";
8
9
  export { Texture } from "./Texture";