I've been working on the similar problem on OpenGL ES. Basically it's the same, just without the ARB extension.
To create ur vertex buffer do this:
// allocate the vertex datauint vertexPosSize = sizeof(GLfloat) * 3 * numVertices;GLfloat vertexPosition = malloc(vertexPosSize); // generate the vertex bufferglGenBuffers(1, &buffers[0]);glBindBuffer(GL_ARRAY_BUFFER, buffers[0]);glBufferData(GL_ARRAY_BUFFER, vertexPosSize, vertexPosition, GL_DYNAMIC_DRAW);// make sure we reset back to the no set buffer //(this can cause other rendering modes to not render if not done)glBindBuffer(GL_ARRAY_BUFFER, 0);
To update the data in the buffer for Dynamic types, do this:
// update the dynamic vertex dataglBindBuffer(GL_ARRAY_BUFFER, buffers[0]);glBufferSubData(GL_ARRAY_BUFFER, 0, vertexPosSize, vertexPosition);glVertexPointer(3, GL_FLOAT, 0, 0);
Obviously if you're using a static buffer you don't need to do that.
To render, i did this. You should be able to use whatever draw method you like, as long as you enable the appropriate client state arrays and bind the buffer for use.
glEnableClientState(GL_VERTEX_ARRAY);// bind the buffer for useglBindBuffer(GL_ARRAY_BUFFER, buffers[0]);// we set the stride and vertex data to zero // because we are using the vertex bufferglVertexPointer(3, GL_FLOAT, 0, 0);// render our objectglDrawElements(GL_TRIANGLE_STRIP, currentUsedIndices - 2, GL_UNSIGNED_SHORT, (const void*)indices);glDisableClientState(GL_VERTEX_ARRAY);
That's the basic jist of how you'd do it, believe me, it was a bit of a pain trying to figure it out especially when the only problem was the lack of one little piece of information that wasn't in the red book, which would of been really handy to know.
For rendering multiple buffers, it would be simply a matter of generating those buffers, binding one buffer, drawing it, then binding the next and drawing that one. And you should be able to do with between a single glEnableClientState and and glDisableClientState. That way you minimise the amount of state change calls made.
You could also isolate the render call, to a single function which has the buffer ids set to it. That way you can isolate the problem into a single rendering function, also, save you some time rewriting a little bit of code : 3
Either way, hope it all helps!