I just wanted to know what the default behavior, if any, of a display list in the event of the following sequence of calls (all calls here are just illustrated for order, not syntax):

//////////////////////////////////////

glGenLists(foo);
glNewList(foo);

// What happens now:

glNewList(foo);
// … Any number more of glNewList(foo)'s
// …

glDeleteLists(foo);

//////////////////////////////////////

My question is, after the list is generated, the first glNewList fills the list. Am I leaking any memory by the subsequent glNewList calls, or am I automagically deleting any memory used by the previous list and reusing/replacing it with the new one?

I ask this question because it gets kindof hard to track the glGenLists/glNewList/glDeleteList cycles, and having to delete a list (or lists) and regenerate all associated lists would be very annoying.

One point I must make is that I haven’t had any adverse effects using the type of code I’ve just questioned. I would like to know whether or not this will break on other video systems down the road.

I’m not talking about issuing a new glGenLists with the same index here, as I absolutely know that doesn’t work properly. I think you end up running out of environment space for the lists.

As per the code above, I’m simply generating a new list atop of an old one.

I too am fairly certain that over time, some issue will crop up with this, but I haven’t had enough time to experiment (unfortunately I’m working on a closed company project in which pretty much video-wise I’m only developing for a single target platform).