PDA

View Full Version : Deleting Shared Textures



dodo
11-04-2003, 10:05 AM
Suppose I share textures between several contexts and delete the texture from one context ( the currently active one), does it get deleted from all the other contexts as well or do I need to make each context current and then delete the texture.?

jwatte
11-04-2003, 01:38 PM
Texture objects are not reference counted. If you need reference counting, you'll have to implement that yourself.

Relic
11-05-2003, 02:38 AM
Wrong.
wglShareLists shares the object's name among all shared contexts.
You can only call glDelete once on the name.
It will finally be deleted as soon as no context has bound it any longer.

V-man
11-05-2003, 10:24 AM
What happens when you have 2 contexts (no sharing yet), and in each you have a texture with ID=5,

then you call wglShareList.

I guess you should call wglShareList from the beginning to avoid the problem.

Rog
11-05-2003, 10:55 AM
Originally posted by V-man:
What happens when you have 2 contexts (no sharing yet), and in each you have a texture with ID=5,

then you call wglShareList.

I guess you should call wglShareList from the beginning to avoid the problem.

The docs says :

The hglrc2 parameter should not contain any existing display lists when wglShareLists is called.

Maybe you should also not have any texture objects defined? I guess it *ought* to fail, but I wouldn't like to guarantee it http://www.opengl.org/discussion_boards/ubb/smile.gif