Skip to main content
GameDev.net gamedev.net
🔒 Locked

Vertex Buffer Objects

Started by SirOnion Aug 5, 2005 at 3:36 PM 0 replies 450+ views
Original Post
SirOnion
SirOnion
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.
SirOnion
SirOnion
Ah! Sorry I didn't see the VBO thread right below mine! I'll look at that

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.