display lists leed to big win386.swp

hi all! i have 3 displaylists (600+ quads) that need to be recalculated periodically. This process

  1. glDeleteLists(1, 3) // if existing
  2. glNewList(1), … glNewList(2), … glNewList(3) … // rebuild lists
  3. display // looks really good!!
  4. do certain things and GOTO STEP 1

seems to leave significant amounts of memory in the swapfile every cyclus. i tested this on different gfx boards (s3, ati, nvidia) -> same result.

any idea?

thank you!

Difficult to answer with these few informations.
If it happens on different OpenGL implementations chances are high that the program itself leaks memory.

Actually you don’t need to delete the lists. Just call glNewList with the desired id and the currently existing list will be overwritten.
glDeleteLists when you exit the program.

BTW, if you periodically regenerate geometry, you might want to look at vertex arrays instead of display lists, too.

just in case, do you call glEndList() for each corresponding glNewList()?

Originally posted by coco:
just in case, do you call glEndList() for each corresponding glNewList()?

I do! I didn’t want to post the whole code. sorry!

Don’t be afraid to show us more if you want more help…
Sharing pieces of code won’t kill trust me :slight_smile: