Advertisement Jump to content
Sign in to follow this  


This topic is 3823 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

I am having a problem drawing multiple VBOs. I have an array of objects (each of the same class) with the same Draw() routine. However, only the first object in the array seems to be drawn and all the others are not visible. The main drawing loop looks something like this:
QVector<Object*> things;  // vector of things to draw

// loop through the vector and draw each thing
foreach(Object *obj, things)

The Draw() routine for each object is the same and looks as follows:

glBindBuffer(GL_ARRAY_BUFFER, normalVBO);        
glNormalPointer(GL_FLOAT, 0, NULL);
glBindBuffer(GL_ARRAY_BUFFER, vertexVBO);
glVertexPointer(3, GL_FLOAT, 0, NULL);
glBindBuffer(GL_ARRAY_BUFFER, texCoordVBO);
glTexCoordPointer(2, GL_FLOAT, 0, NULL);    
// Render the triangles
glDrawArrays(GL_TRIANGLES, 0, totalFaces * 3);

where normalVBO, vertexVBO and texCoordVBO are set for each object when the object is created. Any permutation of the array results in the same phenomenon: only the first object is drawn, and the rest are not shown. Any idea why the other objects are not being drawn? Cheers, EM

Share this post

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

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!