nativeWriteInto method

  1. @override
void nativeWriteInto(
  1. RlVertexBufferC p
)
override

Writes all fields directly into the native struct reference p. For nested structs, use writeInto as well.

Implementation

@override
void nativeWriteInto(RlVertexBufferC p) {
  p.elementCount = elementCount;
  p.vaoId = vaoId;

  for (var i = 0; i < vboIdCount; i++) {
    p.vboId[i] = _vboId.inner[i];
  }

  if (p.vertices.address != 0) {
    for (var i = 0; i < vertices.length; i++) {
      p.vertices[i] = _vertices.inner[i];
    }
  }

  if (p.texcoords.address != 0) {
    for (var i = 0; i < texcoords.length; i++) {
      p.texcoords[i] = _texcoords.inner[i];
    }
  }

  if (p.normals.address != 0) {
    for (var i = 0; i < normals.length; i++) {
      p.normals[i] = _normals.inner[i];
    }
  }

  if (p.colors.address != 0) {
    for (var i = 0; i < colors.length; i++) {
      p.colors[i] = _colors.inner[i];
    }
  }

  if (p.indices.address != 0) {
    for (var i = 0; i < indices.length; i++) {
      p.indices[i] = _indices.inner[i];
    }
  }
}