display lists

I’m just curious here, because I’m having some problems with display lists in my app.

Or at least I think its display lists.

It seems as if some of my display lists are disappearing.

I occasionally have to adjust in the models in my app, so all I do is go through and delete all the previous display lists and rerender new display lists.

Unfortunately I just implemented (fixed a broken feature) which utilizes a display list, and baboom, the main model’s display list disappears.

The strange thing here is that the display list group that contains the model also contains a few other objects, and they’re there. Help…

Siwko

nm.

There seems to be some sort of problem in memory recovery with glDeleteLists, unless I’m just not using it right.

i’ve seen VERY VERY strange results from display lists ( the whole scene f***ed up), just because of giving some lists the same ID ( i didnt use EnumDisplayLists ).
maybe you swapped some of them…

Are you using nested display lists?
Because AFAIK, deleting a child list will invalidate the parent list, yet keep the other child lists intact. Even if you re-use the child list ID.
If this is the case, then you’d have to rebuild your parent list from scratch every time you deleted a child list.

Another possibility is that for some reason you can’t re-use an ID immediately. In other words, you delete list 3, then immediately recreate a list with ID 3 without checking it’s avaliability with glGenLists() or glIsList(). This is just a shot in the dark, so don’t take it as definite.

He Who Ususally Shoots Himself In The Foot When He Takes A Shot In The Dark.

-JohnD

Originally posted by JohnD:
[b]Are you using nested display lists?
Because AFAIK, deleting a child list will invalidate the parent list, yet keep the other child lists intact. Even if you re-use the child list ID.
If this is the case, then you’d have to rebuild your parent list from scratch every time you deleted a child list.

Another possibility is that for some reason you can’t re-use an ID immediately. In other words, you delete list 3, then immediately recreate a list with ID 3 without checking it’s avaliability with glGenLists() or glIsList(). This is just a shot in the dark, so don’t take it as definite.

He Who Ususally Shoots Himself In The Foot When He Takes A Shot In The Dark.

-JohnD[/b]

Just quoting the whole thing cause I’m lazy today. What I was doing was GenListing, then creating the lists, then when any list needed to be modified, all of the lists were deleted and re-gen’d. I was getting some strange behavior that way (disappearing lists).

I did fix it, as far as I can tell. Instead of deleting the lists every time, I initialize them (GenLists) at app startup, and then just overwrite them whenever a change needs to be made. No DeleteLists used until app cleanup. It seems to work fine, but any side effects haven’t been realized yet.