So I have an array of vertices and I am trying to fill in the array with data from a file.
Right now my code looks like the following:
int VertexCount = Input.get();
MVertex Vertices[4] =
{
{0.0f, 0.0f, 0.0f,},
{1.0f, 0.0f, 1.0f,},
{0.0f, 0.0f, 1.0f,},
{1.0f, 0.0f, 0.0f,},
};
Right now it works just fine, except for using VertexCount to initialize the size of the array, but I want to get it so depending on the vertex count I need a for-loop to fill in the data for me. I wanna keep the same array format because for some reason it doesn't work any other way, but like this. I was thinking something along the lines of:
int VertexCount = Input.get();
MVertex Vertices[VertexCount] =
{
for (int i = 0; i < VertexCount; i++)
{
{Input.get(), Input.get(), Input.get(),},
}
};
But that doesn't work I just get some syntax errors. Can someone please show me how to write it?
MVertex.