beginRender method

void beginRender()

Implementation

void beginRender() {
  final gl = Engine.flutterGlPlugin.gl;

  gl.viewport(0, 0, Engine.cameras[Engine.currentCamera].viewport.x,
      Engine.cameras[Engine.currentCamera].viewport.y);
  gl.enable(gl.BLEND);
  gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);

  Engine.prepareCurrentCamera();

  // Clear canvas
  gl.clearColor(0, 0, 0, 1);

  gl.depthFunc(gl.LEQUAL);
  gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
  gl.enable(gl.DEPTH_TEST);
  gl.enable(gl.BLEND);
  gl.enable(gl.ALPHA);

  Engine.clearScene();
}