Dumping an STD::Vector into a VBO

Started by
0 comments, last by RobTheBloke 14 years, 9 months ago
Hello, I was wondering if this code makes sense...

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.
Trying to get over the learning curve
Advertisement
1. Why is the array called 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