zeckensack
05-07-2004, 02:40 AM
MSDN says (http://msdn.microsoft.com/library/en-us/opengl/ntopnglr_2u0k.asp) :
"A rendering context can be current to only one thread at a time. You cannot make a rendering context current to multiple threads."
This isn't precise enough for my tastes. What happens if I try to make current a rendering context that is still current to another thread?
Will the call fail and the "new" thread won't have a GL context?
Or will the call succeed, ie the "new" thread will "steal" the rendering context from the "old" thread?
Is there some sort of specification for this sort of collision, or a consensus between driver developers about what should be going on?
I can of course just check it out, but I don't have hardware from all vendors and neither do I have all Windows versions. Even if my testing shows good results, it wouldn't be anything I could really rely on. So, clarification wanted :)
I know I shouldn't be doing this in the first place, but if you're writing libraries, there's often a need to cover up for flawed client applications.
A workaround has been designed but not implemented yet. It's a sort of FIFO buffer that serializes and transfers data and commands from an arbitrary number of client threads into the context of a single worker thread, which will be the only one that touches OpenGL. This will probably come at a performance penalty and is something I'd rather not waste my time on, if there's a reliable way to avoid it.
"A rendering context can be current to only one thread at a time. You cannot make a rendering context current to multiple threads."
This isn't precise enough for my tastes. What happens if I try to make current a rendering context that is still current to another thread?
Will the call fail and the "new" thread won't have a GL context?
Or will the call succeed, ie the "new" thread will "steal" the rendering context from the "old" thread?
Is there some sort of specification for this sort of collision, or a consensus between driver developers about what should be going on?
I can of course just check it out, but I don't have hardware from all vendors and neither do I have all Windows versions. Even if my testing shows good results, it wouldn't be anything I could really rely on. So, clarification wanted :)
I know I shouldn't be doing this in the first place, but if you're writing libraries, there's often a need to cover up for flawed client applications.
A workaround has been designed but not implemented yet. It's a sort of FIFO buffer that serializes and transfers data and commands from an arbitrary number of client threads into the context of a single worker thread, which will be the only one that touches OpenGL. This will probably come at a performance penalty and is something I'd rather not waste my time on, if there's a reliable way to avoid it.