createBindingState method

Map<String, dynamic> createBindingState(
  1. dynamic vao
)

Implementation

Map<String, dynamic> createBindingState(vao) {
  var newAttributes = List<int>.filled(maxVertexAttributes, 0);
  var enabledAttributes = List<int>.filled(maxVertexAttributes, 0);
  var attributeDivisors = List<int>.filled(maxVertexAttributes, 0);

  for (var i = 0; i < maxVertexAttributes; i++) {
    newAttributes[i] = 0;
    enabledAttributes[i] = 0;
    attributeDivisors[i] = 0;
  }

  return {
    // for backward compatibility on non-VAO support browser
    "geometry": null,
    "program": null,
    "wireframe": false,

    "newAttributes": newAttributes,
    "enabledAttributes": enabledAttributes,
    "attributeDivisors": attributeDivisors,
    "object": vao,
    "attributes": {},
    "index": null
  };
}