std::vector<GLfloat> Indexes;
...Some code to populate the vectors...
glBufferDataARB(GL_ARRAY_BUFFER_ARB, sizeof(GLfloat)*(myModel->Indexes.size()), &myModel->Indexes[0], GL_STATIC_COPY_ARB);
...In the draw loop...
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3, GL_FLOAT, 0, 0);
glDrawArrays(GL_QUADS, 0, myModel->mIndexToRawDraw.size());
I have noticed a strange issue, that when using simple shapes many of the vericies are missing. For example, a box made with a 3d modeler will have its back missing.
Dumping an STD::Vector into a VBO
Hello,
I was wondering if this code makes sense...
1. Why is the array called Indexes?
2. Why does the Indexes array contain floats?
3. What is the relationship between mIndexToRawDraw and Indexes?
2. Why does the Indexes array contain floats?
3. What is the relationship between mIndexToRawDraw and Indexes?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement