PDA

View Full Version : Do i need to delete those objects after using glNewList() ?



07-01-2002, 11:04 AM
Hi, i'm new to OpenGL (and new to windows programming stuff... But trying to write a game in this summer holiday. So i don't have to get out and work under the sun... As a beginner, i know is likely nothing much will happen, but atleast it gives me hope)

Anyway, the question that i wanted to ask is...
After i created a object (say, a cube) with glNewList() function. Do i need to delete it somewhere afterwork/each call? or it will go away after the function has been called?

I'm scare of running out of memory when these WM_ONPAINT() messages floating around, calling these function to create and re-paint objects... >_<


Thanks for helping~~~ ^_^

DFrey
07-01-2002, 02:50 PM
You delete the list when you no longer need to draw it. No reason to recreate it for successive frames. Just reuse it. When your program is finished with the list, then delete it.