activate method Null safety

void activate(
  1. RenderContextWebGL renderContext
)

Implementation

void activate(RenderContextWebGL renderContext) {
  if (contextIdentifier != renderContext.contextIdentifier) {
    _contextIdentifier = renderContext.contextIdentifier;
    _renderingContext = renderContext.rawContext;
    _renderStatistics = renderContext.renderStatistics;
    _renderBufferIndex = renderContext.renderBufferIndex;
    _renderBufferVertex = renderContext.renderBufferVertex;
    _renderBufferIndex.activate(renderContext);
    _renderBufferVertex.activate(renderContext);
    _program = _createProgram(_renderingContext);
    _updateAttributes(_renderingContext, _program);
    _updateUniforms(_renderingContext, _program);
  }

  renderingContext.useProgram(program);
}