Sign in to follow this  

Dumping an STD::Vector into a VBO

This topic is 3096 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
1. Why is the array called Indexes?
2. Why does the Indexes array contain floats?
3. What is the relationship between mIndexToRawDraw and Indexes?

Share this post


Link to post
Share on other sites
Sign in to follow this