Sign in to follow this  
Tokage

Vexing Display List Problem

Recommended Posts

I'm working on an application in which I need to, on occasion, create a new display list with vertices that are determined at run-time from GLU's tesselation library. Every time such a list needs to be created, my program does this:
dispList = glGenLists(1);

glNewList(dispList, GL_COMPILE);
gluTessBeginPolygon(tess, NULL);
	gluTessBeginContour(tess);
	// ... multiple calls to gluTessVertex() ...
	gluTessEndContour(tess);
gluTessEndPolygon(tess);
glEndList();
And it works exactly once. The first time this function is called, everything happens beautifully, but every time after that, it fails. The commands in the display list simply are not executed. I tried replacing the tesselator code with just code to just draw one triangle, and the same thing happens: it works, but only once. I discovered in the debugging process that the first time, glGenLists() returns 769, but every time after that it returns 3. I don't know if this is significant, but I thought I should mention it. Anyway, does anyone have any idea what's going on here? Any help at all would be appreciated. Thanks.

Share this post


Link to post
Share on other sites
Well with DL's they aren't supposed to be use for dynamic meshes AFAIK. The issue is

are you deleting the old list object? and then you should call that code again...

I would move to VBO's if you are using dynamic meshes...

Share this post


Link to post
Share on other sites
Unless deleted the old list object involves more than just calling glDeleteLists(dispList) after I'm done with it, yes, I delete the old list object. Perhaps it's noteworthy that when I hard-coded it to always use display list 769, it worked every time (yes, I know this is not actually a solution) but when I made it use list 3, it never worked, not even the first time. So it seems to me that display list 3, the return value I get every time after the first, is somehow "bad."

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this