Advertisement Jump to content
Sign in to follow this  

Vertex Buffer Objects

This topic is 4919 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
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!