I’ve got:
public List<VertexPositionColor> chunk_vertices;
public List<int> chunk_indices;
Then
VertexBuffer vertex_buffer;
vertex_buffer = new VertexBuffer(device, VertexPositionColor.VertexDeclaration, test_chunk.chunk_vertices.Count, BufferUsage.WriteOnly);
vertex_buffer.SetData(test_chunk.chunk_vertices);
I’ve tried:
vertex_buffer.SetData<VertexPositionColor>(test_chunk.chunk_vertices);
and
vertex_buffer.SetData<List<VertexPositionColor>>(test_chunk.chunk_vertices);
The
VertexBuffer.SetDatamethod expects an array, so changechunk_verticesto an array, or use the code below: