import { PrefixUnaryExpression } from "typescript";

import * as PIXI from "pixi.js";

PIXI.settings.SCALE_MODE = PIXI.SCALE_MODES.NEAREST;

export default class RenderBackend {
  private app: PIXI.Application;

  constructor(elem: HTMLElement) {
    this.app = new PIXI.Application({
      resizeTo: window,
      antialias: false,
      transparent: false,
      resolution: 1,
    });
    elem.appendChild(this.app.view);

    window.addEventListener("resize", () => {
      this.app.queueResize();
    });
    this.app.queueResize();
  }
}
