@galacean/engine-rhi-webgl 2.0.0-alpha.38 → 2.0.0-alpha.40
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/main.js +116 -68
- package/dist/main.js.map +1 -1
- package/dist/module.js +117 -69
- package/dist/module.js.map +1 -1
- package/package.json +4 -4
- package/types/WebCanvas.d.ts +15 -19
- package/types/WebGLEngine.d.ts +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-rhi-webgl",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.40",
|
|
4
4
|
"repository": {
|
|
5
5
|
"url": "https://github.com/galacean/engine.git"
|
|
6
6
|
},
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
"types/**/*"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@galacean/engine-core": "2.0.0-alpha.
|
|
22
|
-
"@galacean/engine-math": "2.0.0-alpha.
|
|
21
|
+
"@galacean/engine-core": "2.0.0-alpha.40",
|
|
22
|
+
"@galacean/engine-math": "2.0.0-alpha.40"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@galacean/engine-design": "2.0.0-alpha.
|
|
25
|
+
"@galacean/engine-design": "2.0.0-alpha.40"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
28
|
"b:types": "tsc"
|
package/types/WebCanvas.d.ts
CHANGED
|
@@ -1,35 +1,31 @@
|
|
|
1
1
|
import { Canvas } from "@galacean/engine-core";
|
|
2
|
-
import { Vector2 } from "@galacean/engine-math";
|
|
3
2
|
type OffscreenCanvas = any;
|
|
4
3
|
/**
|
|
5
4
|
* The canvas used on the web, which can support HTMLCanvasElement and OffscreenCanvas.
|
|
6
5
|
*/
|
|
7
6
|
export declare class WebCanvas extends Canvas {
|
|
7
|
+
private static _devicePixelContentBoxSupported?;
|
|
8
|
+
private static _supportsDevicePixelContentBox;
|
|
8
9
|
_webCanvas: HTMLCanvasElement | OffscreenCanvas;
|
|
9
|
-
private
|
|
10
|
+
private _resizeObserver?;
|
|
11
|
+
private _autoResolutionScale;
|
|
12
|
+
private _resolutionDirty;
|
|
13
|
+
private _pendingDevicePixelWidth;
|
|
14
|
+
private _pendingDevicePixelHeight;
|
|
10
15
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
16
|
+
* @inheritdoc
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* The canvas must have a CSS-constrained display size; otherwise auto-resolution disables itself.
|
|
13
20
|
*/
|
|
14
|
-
|
|
15
|
-
set scale(value: Vector2);
|
|
16
|
-
/**
|
|
17
|
-
* Resize the rendering size according to the clientWidth and clientHeight of the canvas.
|
|
18
|
-
* @param pixelRatio - Pixel ratio
|
|
19
|
-
*/
|
|
20
|
-
resizeByClientSize(pixelRatio?: number): void;
|
|
21
|
+
setAutoResolution(scale?: number): void;
|
|
21
22
|
/**
|
|
22
23
|
* Create a web canvas.
|
|
23
24
|
* @param webCanvas - Web native canvas
|
|
24
25
|
*/
|
|
25
26
|
constructor(webCanvas: HTMLCanvasElement | OffscreenCanvas);
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
* @param y - Scale along the Y axis
|
|
30
|
-
*/
|
|
31
|
-
setScale(x: number, y: number): void;
|
|
32
|
-
protected _onWidthChanged(value: number): void;
|
|
33
|
-
protected _onHeightChange(value: number): void;
|
|
27
|
+
private _setResolutionByClientSizeFallback;
|
|
28
|
+
protected _exitAutoResolution(): void;
|
|
29
|
+
protected _onResolutionChanged(width: number, height: number): void;
|
|
34
30
|
}
|
|
35
31
|
export {};
|
package/types/WebGLEngine.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Engine, EngineConfiguration } from "@galacean/engine-core";
|
|
|
2
2
|
import { WebGLGraphicDeviceOptions } from "./";
|
|
3
3
|
import { WebCanvas } from "./WebCanvas";
|
|
4
4
|
/**
|
|
5
|
-
* WebGL platform engine,
|
|
5
|
+
* WebGL platform engine, supports WebGL 1.0 and WebGL 2.0.
|
|
6
6
|
*/
|
|
7
7
|
export declare class WebGLEngine extends Engine {
|
|
8
8
|
/**
|
|
@@ -12,12 +12,12 @@ export declare class WebGLEngine extends Engine {
|
|
|
12
12
|
*/
|
|
13
13
|
static create(configuration: WebGLEngineConfiguration): Promise<WebGLEngine>;
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* The web canvas the engine renders to.
|
|
16
16
|
*/
|
|
17
17
|
get canvas(): WebCanvas;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* Options for `WebGLEngine.create()`.
|
|
21
21
|
*/
|
|
22
22
|
export interface WebGLEngineConfiguration extends EngineConfiguration {
|
|
23
23
|
/** Canvas element or canvas id. */
|