[Openal] how to dynamically load openAL (win32) ??
Garin Hiebert
garinh at cheesetoast.net
Sat Nov 18 16:37:14 PST 2006
> check if openAL dll is already installed;
> if yes,
> load that dll
> else
> extract the dll from my game's archive
> load that dll
>
It's probably easiest to just include the OpenAL installer within your
game installer. Run it with the "/s" option (silent mode) so that it
doesn't display anything or have any interaction with the user.
OpenAL Installer --
http://developer.creative.com/articles/article.asp?cat=1&sbcat=31&top=38&aid=46
Some games will just include their own app-local version of the
wrapper. The downside of this approach is added complexity if you want
to provide access to enumerated devices in the system directory. You're
really pretty safe just using the OpenAL installer -- then your app gets
the ability to enumerate all available devices in a pretty
straightforward way.
> of to do that? i know there is LoadLibrary("mydll.dll");
> but what got me confused is that it seems i would, if i load
> dynamically, need to call GetProcAddress for all these openAL functions
> i want to use...
> can't i somehow just use the openAL headers ??
>
There's code in LoadOAL.cpp and LoadOAL.h, which comes with the OpenAL
SDK, showing how to do this. You can copy the code, or use it for
reference. For a game, it's probably best to do things this way so that
the product can report a library-loading error itself rather than having
Windows do it.
OpenAL SDK --
http://developer.creative.com/articles/article.asp?cat=1&sbcat=31&top=38&aid=45
Garin
More information about the Openal
mailing list