Re: multithreaded multidevice app problems
Chris Robinson <[email protected]> Thu, 26 Apr 2012 20:31:15 -0700
| Newsgroups | gmane.comp.lib.openal |
|---|---|
| Message-ID | <2090728.42sHuAGH6M@kittycat> |
On Thursday, April 26, 2012 10:19:26 PM Bruce Clay wrote: > In > searching the web I found messages that said a process can only have one > context. Does that apply to the whole process or should a thread acting > with it's own instance of OpenAL and it's own headset work? Hi. What do you mean by an "instance of OpenAL"? The one-active-context-per- process restriction is based on the DLLs being called. If you're using the same DLL but with multiple devices (whether that's OpenAL32.dll, wrap_oal.dll, or whatever else), there can still only be one active context per process. If you're somehow loading multiple separate DLLs (and not the same DLL multiple times), then whichever DLL's functions you call is the one that will be affected. OpenAL Soft[1] has a cleaner way around this, though. It has a new-ish extension called ALC_EXT_thread_local_context[2], which provides functions to make a context active only on the calling thread, so each thread can have a different context. You could create 4 devices for 4 separate headsets, 1 context from each device, and set each context as current on 4 separate threads, then they'll all work independently. [1] http://kcat.strangesoft.net/openal.html [2] http://kcat.strangesoft.net/openal-extensions/EXT_thread_local_context.txt Hope that helps. :) _______________________________________________ Openal mailing list [email protected] http://opensource.creative.com/mailman/listinfo/openal