Skip to main content
GameDev.net gamedev.net
🔒 Locked

multiple threads

Started by steelbreeze Nov 9, 2004 at 1:13 AM 0 replies 350+ views
Original Post
steelbreeze
steelbreeze
Hi, I am developing effects for a video editor. I have a situation where within the framework I'm using, every call of the Frameprocessor spawns a new OpenGL thread(i have a global window (handle)created at DLL load, which is valid till application quits). The saving grace is that often the same threadID turns up repeatedly. To handle the unique rendering contexts that need to be created for each threadID, i use a STL map where i store threadIDs and the corresponding contexts. i also need to create textures for each context(tried wglsharelists(), didn't work in a case where the threads are different, works when there are multiple windows/RCs but on only one thread). Now say a texture created has ID 1. For each thread it is bound to have textureID 1. Say when I'm done with the thread, I try to delete the texture, with ID as 1, and it fails. Only when the last thread is released, the texture ID 1 is actually released. which means the textures created on the previous threads are all kept dangling! Can somebody explain the behavior? Is it that I need to release the textures/RC in the reverse order of their creation? thanks in advance, steel

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.