Compare commits

...

2 Commits

Author SHA1 Message Date
88ca86ae54 Merge pull request 'Fixed problem if webgpu is not available and added alert to show the problem. Maybe somewhere in the future i will use toasts for this.' (#30) from bugfix/webgpu into main
All checks were successful
Build, Test & Push Frontend / quality-check (push) Successful in 1m39s
Build, Test & Push Frontend / docker (push) Successful in 1m31s
Reviewed-on: #30
2026-03-05 10:58:54 +01:00
Andreas Dahm
24c4dd3290 Fixed problem if webgpu is not available and added alert to show the problem. Maybe somewhere in the future i will use toasts for this.
Some checks failed
Build, Test & Push Frontend / docker (pull_request) Has been cancelled
Build, Test & Push Frontend / quality-check (pull_request) Has been cancelled
2026-03-05 10:57:07 +01:00
2 changed files with 14 additions and 13 deletions

View File

@@ -101,10 +101,10 @@
}
</div>
@if(entry.key !== xpKeys.at(xpKeys.length-1)?.key)
{
<mat-divider></mat-divider>
}
@if(entry.key !== xpKeys.at(xpKeys.length-1)?.key)
{
<mat-divider></mat-divider>
}
}
</div>
</mat-card>

View File

@@ -52,19 +52,16 @@ export class BabylonCanvas implements AfterViewInit, OnDestroy {
window.removeEventListener('resize', this.resizeHandler);
const canvas = this.canvasRef?.nativeElement;
if (canvas) {
canvas.removeEventListener('wheel', this.wheelHandler);
}
canvas?.removeEventListener('wheel', this.wheelHandler);
if (this.engine) {
this.engine.dispose();
}
this.engine?.dispose();
}
private async initBabylon(): Promise<void> {
const canvas = this.canvasRef.nativeElement;
this.engine = new WebGPUEngine(canvas);
await this.engine.initAsync().then(() => {
const tmpEngine = new WebGPUEngine(canvas);
await tmpEngine.initAsync().then(() => {
this.engine = tmpEngine;
this.scene = new Scene(this.engine);
this.setupCamera(canvas);
this.addListener(canvas);
@@ -75,7 +72,11 @@ export class BabylonCanvas implements AfterViewInit, OnDestroy {
engine: this.engine
});
this.addRenderLoop(canvas);
});
})
.catch(() => {
alert("WebGPU could not be started. Please check your browser if it supports WebGPU.");
this.engine = null!;
});
}
private addListener(canvas: HTMLCanvasElement) {