Vertices.raw constructor

Vertices.raw(VertexMode mode, Float32List positions, { Float32List textureCoordinates, Int32List colors, Int32List indices })

Implementation

Vertices.raw(
  VertexMode mode,
  Float32List positions, {
  Float32List textureCoordinates,
  Int32List colors,
  Int32List indices,
}) : assert(mode != null),
     assert(positions != null) {
  if (textureCoordinates != null && textureCoordinates.length != positions.length)
    throw new ArgumentError('"positions" and "textureCoordinates" lengths must match.');
  if (colors != null && colors.length * 2 != positions.length)
    throw new ArgumentError('"positions" and "colors" lengths must match.');
  if (indices != null && indices.any((int i) => i < 0 || i >= positions.length))
    throw new ArgumentError('"indices" values must be valid indices in the positions list.');

  _constructor();
  _init(mode.index, positions, textureCoordinates, colors, indices);
}