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

Using Display Lists

Started by moonwalkercs Oct 16, 2005 at 3:30 PM 1 replies 950+ views
Original Post
moonwalkercs
moonwalkercs
I have a program that gets a list of object files, reads in the objects, and then displays them. I am trying to create a display list for each object with the following code: front=glGenLists(numObjs); for(i=0; i> file; LoaderClass.LoadObj(file); ObjModel a = LoaderClass.ReturnObj(); obj.push_back(LoaderClass.ReturnObj()); objectData.r=0.2; objectData.g=0.4; objectData.b=0.6; objectData.isPicked=false; glNewList((front+i),GL_COMPILE); for(int j=0; j.r, objectData.g, objectData.b); if(mode==GL_SELECT){ glLoadName((GLuint)(i)); } glCallList(front+i); } When i do this nothing shows up. Am I going about creating the lists in the right way, or should I do it someway else?
CRACK123
CRACK123
Firstly does it work without putting it into the display list ? If it does try using the glIsList to check if the display list got generated correctly. You can also check if front is 0 - glGenLists returns 0 on error. Otherwise I don't see anything wrong in the way you are creating a display list. Also if this is in a seperate function make sure you are calling this function (I have been guilty of it many times - creating a display list and never calling that function and wondering why the display list is not working)

Hope this helps
The more applications I write, more I find out how less I know
DIB
DIB
I don't think that this is your problem, but you might be able to speed things up if you moved your "glBegin(GL_TRIANGLES);" and "glEnd()" outside your "for" loop.

Sorry I couldn't help on your display list problem. Just for something obvious, ensure that "front" is the same value in both functions.

Topic Locked

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

Sign in to reply to this topic.