Add insights

This commit is contained in:
schmelczerandras 2020-10-20 23:09:53 +02:00
parent 49ea5f3e86
commit b445961ad5
8 changed files with 94 additions and 1 deletions

View file

@ -12,6 +12,7 @@ export class RainScene implements Scene {
private canvas: HTMLCanvasElement;
private overlay: HTMLDivElement;
public renderer?: Renderer;
public async run(canvas: HTMLCanvasElement, overlay: HTMLDivElement): Promise<void> {
this.canvas = canvas;
@ -46,6 +47,8 @@ export class RainScene implements Scene {
currentTime: DOMHighResTimeStamp,
deltaTime: DOMHighResTimeStamp
): boolean {
this.renderer = renderer;
const { width, height } = this.canvas.getBoundingClientRect();
renderer.setViewArea(vec2.fromValues(0, height), vec2.fromValues(width, height));
this.overlay.innerText = prettyPrint(renderer.insights);