View Full Version : What to clear when closing an OpenGL windows?

Anonymous Coward
08-25-2000, 01:43 AM
I should delete Texture objects with glDeleteTexture(), what else should someone clear when closing a window? pointers?

08-25-2000, 02:39 AM
display lists,

rendering context
device context

all other memory allocated

08-25-2000, 04:10 AM
For performance you should be using a private DC (CS_OWNDC in the window class) - you don't need to release these, and in fact calling ReleaseDC on one will fail harmlessly.

I thought texture objects and dlists are automatically cleaned up when their RC is deleted, but I wouldn't swear to it.

08-25-2000, 04:35 AM
They supposedly are, but it is always good practive to release memory you allocated just in case the platform you are running one doesn't do that job too well for you.