PDA

View Full Version : Using display lists and need help creating VBOs instead.



JohnFalk
03-25-2005, 02:17 AM
I load 3DS models with Lev P's L3DS ( http://www.levp.de/3d/3ds/ ), then i create display lists with this code:


// Generate display list for the model.
dispListModel_GLuint = glGenLists(1);

// Create a display list for the model.
glNewList(dispListModel_GLuint, GL_COMPILE);
for(uint i= 0; i < model_L3DS.GetMeshCount(); i++)
{
glVertexPointer(4, GL_FLOAT, 0, &amp;model_L3DS.GetMesh(i).GetVertex(0));
glNormalPointer(GL_FLOAT, 0, &amp;model_L3DS.GetMesh(i).GetNormal(0));
glColorPointer(3, GL_FLOAT, 0, &amp;model_L3DS.GetMesh(i).GetBinormal(0));
glTexCoordPointer(2, GL_FLOAT, 0, &amp;model_L3DS.GetMesh(i).GetUV(0));
glDrawElements(GL_TRIANGLES, model_L3DS.GetMesh(i).GetTriangleCount()*3, GL_UNSIGNED_SHORT, &amp;model_L3DS.GetMesh(i).GetTriangle(0));
}
glColor3f(1.0, 1.0, 1.0);
glEndList();It works very well, but i want to try out VBOs. How do i do that?

desrever
03-28-2005, 06:19 PM
I suggest the following white paper to get you started:

http://developer.nvidia.com/object/using_VBOs.html