I ran into something weird while merging 2 vertex arrays:
I have an empty vertex array called "vaInterface", and a vertexarray called just "va" in a class called "PanelBottom" with a size of 4. Both are quads. I append "va" and the size of "vaInterface" becomes 8! code:
std::cout << vaInterface.getVertexCount() << std::endl; // PRINTS 0
std::cout << objPanelBottom.va.getVertexCount() << std::endl; // PRINTS 4
std::cout << vaInterface.getVertexCount() + objPanelBottom.va.getVertexCount() << std::endl; // PRINTS 4
vaInterface.resize(vaInterface.getVertexCount() + objPanelBottom.va.getVertexCount());
for (unsigned int i = 0; i < objPanelBottom.va.getVertexCount(); i++)
{
vaInterface.append(objPanelBottom.va[i]);
}
std::cout << vaInterface.getVertexCount() << std::endl; // PRINTS 8
If I then print the positions of each vertex, the first 4 are all 0s. 5 through 8 are positioned correctly.
Anyone know why this is?
edit: VertexCount keeps doubling when I append other vertexarrays to vaInterface. I added another vertexarray with size 4 and now the total size is 16 when it should be 8.