reset method

dynamic reset(
  1. dynamic renderTarget
)

Implementation

reset(renderTarget) {
  if (renderTarget == null) {
    var size = this.renderer.getSize(new Vector2(null, null));
    this._pixelRatio = this.renderer.getPixelRatio();
    this._width = size.width.toInt();
    this._height = size.height.toInt();

    renderTarget = this.renderTarget1.clone();
    renderTarget.setSize(
        this._width * this._pixelRatio, this._height * this._pixelRatio);
  }

  this.renderTarget1.dispose();
  this.renderTarget2.dispose();
  this.renderTarget1 = renderTarget;
  this.renderTarget2 = renderTarget.clone();

  this.writeBuffer = this.renderTarget1;
  this.readBuffer = this.renderTarget2;
}