get method

WebGLRenderState get(
  1. dynamic scene, {
  2. int renderCallDepth = 0,
})

Implementation

WebGLRenderState get(scene, {int renderCallDepth = 0}) {
  WebGLRenderState renderState;

  if (renderStates.has(scene) == false) {
    renderState = WebGLRenderState(extensions, capabilities);
    renderStates.add(key: scene, value: [renderState]);
  } else {
    if (renderCallDepth >= renderStates.get(scene).length) {
      renderState = WebGLRenderState(extensions, capabilities);
      renderStates.get(scene).add(renderState);
    } else {
      renderState = renderStates.get(scene)[renderCallDepth];
    }
  }

  return renderState;
}