Jump to content
  • Advertisement
Sign in to follow this  
SirOnion

Vertex Buffer Objects

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

Before my HD wiped I was playing with VBO and I made an example like the one in the Superbible with a 3x3x3 cube of spheres made up of 30,000 points and it worked, but I wanted to remake it and I can't get it working, it crashes all the time. In InitGL() function I have glEnableClientState(GL_VERTEX_ARRAY); glGenBuffers(1,&vbo); Then I would call the function that generates the 30,000 points free(sphereCloud); sphereCloud = (GLfloat *)malloc(sizeof(GLfloat)*MAX_POINTS*3); //Generate points glBindBuffer(GL_ARRAY_BUFFER,vbo); glBufferData(GL_ARRAY_BUFFER,sizeof(GLfloat)*MAX_POINTS*3,sphereCloud,GL_DYNAMIC_DRAW); Then in the Drawing Function glBindBuffer(GL_ARRAY_BUFFER,vbo); glVertexPointer(3,GL_FLOAT,0,0); glDrawArrays(GL_POINTS,0,MAX_POINTS); MaxPoints was defined as 30,000 If I got rid of the VBO and just had glVertexPointer with sphereCloud instead of 0 as the last parameter it would work fine but very slow.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!