The glGenBuffersARB create a new vertex buffer object and return the ID of the vbo to a local variable.

 
    GLuint id = 0;  
 
    glGenBuffersARB(1, &id);                       
 

First parameter is the number of buffers needs to be created.

What is vbo?

OpenGL provided an extension ARB_vertex_buffer_object allows you to put the vertex data directly into video memory to gain the render speed.

The advantage of vbo is that you can specify how you intend to use it, so the graphics driver can optimize the vbo. Two factors of optimization are render speed and write speed. Different data need different strategy.

Rarely changed data should be put into video memory to gain the render speed. Frequently changed data should be stored in AGP memory for fast write.

The buffer stay in video memory called static buffer, buffer stay in AGP memory called dynamic buffer.

glGenBuffersARB is one of the API to manipulate the vbo. The DirectX API also provided similar interfaces like IDirect3DVertexBuffer9 and IDirect3DIndexBuffer9.

Other APIs include glBindBufferARB and glBufferDataARB. glBindBufferARB is used to bind the vertex buffer created by glGenBuffersARB as active buffer, so you can upload data to the buffer.

 
glBindBufferARB( GL_ARRAY_BUFFER_ARB, id);
 

glBufferDataARB uploads the data to the currently active buffer.

 
glBufferDataARB(
GL_ARRAY_BUFFER_ARB,
numVertex * sizeof( Vertex),
vertex_data,
GL_STATIC_DRAW_ARB
);
 

Release vbo

To release vbo, just pass the zero to glBindBufferARB's id parameter.

 
glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);