Skip to content

Commit

Permalink
chore: add securecontext warning
Browse files Browse the repository at this point in the history
  • Loading branch information
lslzl3000 committed Sep 24, 2024
1 parent 7d0b329 commit c542e1b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 23 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s"
},
"devDependencies": {
"@webgpu/types": "^0.1.40",
"@webgpu/types": "^0.1.45",
"conventional-changelog-cli": "^2.2.2",
"electron": "^31.1.0",
"typedoc": "^0.25.7",
Expand Down
14 changes: 7 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 2 additions & 14 deletions src/Engine3D.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ export class Engine3D {
*/
public static inputSystem: InputSystem;

/**
* input system in engine3d
*/
public static divB: HTMLDivElement;

/**
* more view in engine3d
*/
Expand Down Expand Up @@ -324,15 +319,8 @@ export class Engine3D {
*/
public static async init(descriptor: { canvasConfig?: CanvasConfig; beforeRender?: Function; renderLoop?: Function; lateRender?: Function, engineSetting?: EngineSetting } = {}) {
console.log('Engine Version', version);

// for dev debug
if (import.meta.env.DEV) {
this.divB = document.createElement("div");
this.divB.style.position = 'absolute'
this.divB.style.zIndex = '999'
this.divB.style.color = '#FFFFFF'
this.divB.style.top = '150px'
document.body.appendChild(this.divB);
if (!window.isSecureContext){
console.warn('WebGPU is only supported in secure contexts (HTTPS or localhost)')
}

this.setting = { ...this.setting, ...descriptor.engineSetting }
Expand Down
2 changes: 1 addition & 1 deletion src/gfx/graphics/webGpu/Context3D.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export class Context3D extends CEventDispatcher {
format: this.presentationFormat,
usage: GPUTextureUsage.COPY_DST | GPUTextureUsage.RENDER_ATTACHMENT,
alphaMode: 'premultiplied',
colorSpace: `srgb`,
colorSpace: `srgb`
});

this._resizeEvent = new CResizeEvent(CResizeEvent.RESIZE, { width: this.windowWidth, height: this.windowHeight })
Expand Down

0 comments on commit c542e1b

Please sign in to comment.