• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

src/audio/src/OALFramework/LoadOAL.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2006, Creative Labs Inc.
00003  * All rights reserved.
00004  * 
00005  * Redistribution and use in source and binary forms, with or without modification, are permitted provided
00006  * that the following conditions are met:
00007  * 
00008  *     * Redistributions of source code must retain the above copyright notice, this list of conditions and
00009  *           the following disclaimer.
00010  *     * Redistributions in binary form must reproduce the above copyright notice, this list of conditions
00011  *           and the following disclaimer in the documentation and/or other materials provided with the distribution.
00012  *     * Neither the name of Creative Labs Inc. nor the names of its contributors may be used to endorse or
00013  *           promote products derived from this software without specific prior written permission.
00014  * 
00015  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
00016  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
00017  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
00018  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
00019  * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00020  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00021  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00022  * POSSIBILITY OF SUCH DAMAGE.
00023  */
00024 
00025 #include "../h/OpenAL.h"
00026 //#include "LoadOAL.h"
00027 
00028 HINSTANCE g_hOpenALDLL = NULL;
00029 
00030 ALboolean LoadOAL10Library(rchar *szOALFullPathName, LPOPENALFNTABLE lpOALFnTable)
00031 {
00032         if (!lpOALFnTable)
00033                 return AL_FALSE;
00034 
00035         if (szOALFullPathName)
00036                 g_hOpenALDLL = LOADDLL(szOALFullPathName);
00037         else
00038                 g_hOpenALDLL = LOADDLL("openal32.dll");
00039         
00040         if (!g_hOpenALDLL)
00041                 return AL_FALSE;
00042 
00043         memset(lpOALFnTable, 0, sizeof(OPENALFNTABLE));
00044 
00045         // Get function pointers
00046         lpOALFnTable->alEnable = (LPALENABLE)GetProcAddress(g_hOpenALDLL, "alEnable");
00047         if (lpOALFnTable->alEnable == NULL)
00048         {
00049                 OutputDebugString(_T("Failed to retrieve 'alEnable' function address\n"));
00050                 return AL_FALSE;
00051         }
00052         lpOALFnTable->alDisable = (LPALDISABLE)GetProcAddress(g_hOpenALDLL, "alDisable");
00053         if (lpOALFnTable->alDisable == NULL)
00054         {
00055                 OutputDebugString(_T("Failed to retrieve 'alDisable' function address\n"));
00056                 return AL_FALSE;
00057         }
00058         lpOALFnTable->alIsEnabled = (LPALISENABLED)GetProcAddress(g_hOpenALDLL, "alIsEnabled");
00059         if (lpOALFnTable->alIsEnabled == NULL)
00060         {
00061                 OutputDebugString(_T("Failed to retrieve 'alIsEnabled' function address\n"));
00062                 return AL_FALSE;
00063         }
00064         lpOALFnTable->alGetBoolean = (LPALGETBOOLEAN)GetProcAddress(g_hOpenALDLL, "alGetBoolean");
00065         if (lpOALFnTable->alGetBoolean == NULL)
00066         {
00067                 OutputDebugString(_T("Failed to retrieve 'alGetBoolean' function address\n"));
00068                 return AL_FALSE;
00069         }
00070         lpOALFnTable->alGetInteger = (LPALGETINTEGER)GetProcAddress(g_hOpenALDLL, "alGetInteger");
00071         if (lpOALFnTable->alGetInteger == NULL)
00072         {
00073                 OutputDebugString(_T("Failed to retrieve 'alGetInteger' function address\n"));
00074                 return AL_FALSE;
00075         }
00076         lpOALFnTable->alGetFloat = (LPALGETFLOAT)GetProcAddress(g_hOpenALDLL, "alGetFloat");
00077         if (lpOALFnTable->alGetFloat == NULL)
00078         {
00079                 OutputDebugString(_T("Failed to retrieve 'alGetFloat' function address\n"));
00080                 return AL_FALSE;
00081         }
00082         lpOALFnTable->alGetDouble = (LPALGETDOUBLE)GetProcAddress(g_hOpenALDLL, "alGetDouble");
00083         if (lpOALFnTable->alGetDouble == NULL)
00084         {
00085                 OutputDebugString(_T("Failed to retrieve 'alGetDouble' function address\n"));
00086                 return AL_FALSE;
00087         }
00088         lpOALFnTable->alGetBooleanv = (LPALGETBOOLEANV)GetProcAddress(g_hOpenALDLL, "alGetBooleanv");
00089         if (lpOALFnTable->alGetBooleanv == NULL)
00090         {
00091                 OutputDebugString(_T("Failed to retrieve 'alGetBooleanv' function address\n"));
00092                 return AL_FALSE;
00093         }
00094         lpOALFnTable->alGetIntegerv = (LPALGETINTEGERV)GetProcAddress(g_hOpenALDLL, "alGetIntegerv");
00095         if (lpOALFnTable->alGetIntegerv == NULL)
00096         {
00097                 OutputDebugString(_T("Failed to retrieve 'alGetIntegerv' function address\n"));
00098                 return AL_FALSE;
00099         }
00100         lpOALFnTable->alGetFloatv = (LPALGETFLOATV)GetProcAddress(g_hOpenALDLL, "alGetFloatv");
00101         if (lpOALFnTable->alGetFloatv == NULL)
00102         {
00103                 OutputDebugString(_T("Failed to retrieve 'alGetFloatv' function address\n"));
00104                 return AL_FALSE;
00105         }
00106         lpOALFnTable->alGetDoublev = (LPALGETDOUBLEV)GetProcAddress(g_hOpenALDLL, "alGetDoublev");
00107         if (lpOALFnTable->alGetDoublev == NULL)
00108         {
00109                 OutputDebugString(_T("Failed to retrieve 'alGetDoublev' function address\n"));
00110                 return AL_FALSE;
00111         }
00112         lpOALFnTable->alGetString = (LPALGETSTRING)GetProcAddress(g_hOpenALDLL, "alGetString");
00113         if (lpOALFnTable->alGetString == NULL)
00114         {
00115                 OutputDebugString(_T("Failed to retrieve 'alGetString' function address\n"));
00116                 return AL_FALSE;
00117         }
00118         lpOALFnTable->alGetError = (LPALGETERROR)GetProcAddress(g_hOpenALDLL, "alGetError");
00119         if (lpOALFnTable->alGetError == NULL)
00120         {
00121                 OutputDebugString(_T("Failed to retrieve 'alGetError' function address\n"));
00122                 return AL_FALSE;
00123         }
00124         lpOALFnTable->alIsExtensionPresent = (LPALISEXTENSIONPRESENT)GetProcAddress(g_hOpenALDLL, "alIsExtensionPresent");
00125         if (lpOALFnTable->alIsExtensionPresent == NULL)
00126         {
00127                 OutputDebugString(_T("Failed to retrieve 'alIsExtensionPresent' function address\n"));
00128                 return AL_FALSE;
00129         }
00130         lpOALFnTable->alGetProcAddress = (LPALGETPROCADDRESS)GetProcAddress(g_hOpenALDLL, "alGetProcAddress");
00131         if (lpOALFnTable->alGetProcAddress == NULL)
00132         {
00133                 OutputDebugString(_T("Failed to retrieve 'alGetProcAddress' function address\n"));
00134                 return AL_FALSE;
00135         }
00136         lpOALFnTable->alGetEnumValue = (LPALGETENUMVALUE)GetProcAddress(g_hOpenALDLL, "alGetEnumValue");
00137         if (lpOALFnTable->alGetEnumValue == NULL)
00138         {
00139                 OutputDebugString(_T("Failed to retrieve 'alGetEnumValue' function address\n"));
00140                 return AL_FALSE;
00141         }
00142         lpOALFnTable->alListeneri = (LPALLISTENERI)GetProcAddress(g_hOpenALDLL, "alListeneri");
00143         if (lpOALFnTable->alListeneri == NULL)
00144         {
00145                 OutputDebugString(_T("Failed to retrieve 'alListeneri' function address\n"));
00146                 return AL_FALSE;
00147         }
00148         lpOALFnTable->alListenerf = (LPALLISTENERF)GetProcAddress(g_hOpenALDLL, "alListenerf");
00149         if (lpOALFnTable->alListenerf == NULL)
00150         {
00151                 OutputDebugString(_T("Failed to retrieve 'alListenerf' function address\n"));
00152                 return AL_FALSE;
00153         }
00154         lpOALFnTable->alListener3f = (LPALLISTENER3F)GetProcAddress(g_hOpenALDLL, "alListener3f");
00155         if (lpOALFnTable->alListener3f == NULL)
00156         {
00157                 OutputDebugString(_T("Failed to retrieve 'alListener3f' function address\n"));
00158                 return AL_FALSE;
00159         }
00160         lpOALFnTable->alListenerfv = (LPALLISTENERFV)GetProcAddress(g_hOpenALDLL, "alListenerfv");
00161         if (lpOALFnTable->alListenerfv == NULL)
00162         {
00163                 OutputDebugString(_T("Failed to retrieve 'alListenerfv' function address\n"));
00164                 return AL_FALSE;
00165         }
00166         lpOALFnTable->alGetListeneri = (LPALGETLISTENERI)GetProcAddress(g_hOpenALDLL, "alGetListeneri");
00167         if (lpOALFnTable->alGetListeneri == NULL)
00168         {
00169                 OutputDebugString(_T("Failed to retrieve 'alGetListeneri' function address\n"));
00170                 return AL_FALSE;
00171         }
00172         lpOALFnTable->alGetListenerf =(LPALGETLISTENERF)GetProcAddress(g_hOpenALDLL, "alGetListenerf");
00173         if (lpOALFnTable->alGetListenerf == NULL)
00174         {
00175                 OutputDebugString(_T("Failed to retrieve 'alGetListenerf' function address\n"));
00176                 return AL_FALSE;
00177         }
00178         lpOALFnTable->alGetListener3f = (LPALGETLISTENER3F)GetProcAddress(g_hOpenALDLL, "alGetListener3f");
00179         if (lpOALFnTable->alGetListener3f == NULL)
00180         {
00181                 OutputDebugString(_T("Failed to retrieve 'alGetListener3f' function address\n"));
00182                 return AL_FALSE;
00183         }
00184         lpOALFnTable->alGetListenerfv = (LPALGETLISTENERFV)GetProcAddress(g_hOpenALDLL, "alGetListenerfv");
00185         if (lpOALFnTable->alGetListenerfv == NULL)
00186         {
00187                 OutputDebugString(_T("Failed to retrieve 'alGetListenerfv' function address\n"));
00188                 return AL_FALSE;
00189         }
00190         lpOALFnTable->alGenSources = (LPALGENSOURCES)GetProcAddress(g_hOpenALDLL, "alGenSources");
00191         if (lpOALFnTable->alGenSources == NULL)
00192         {
00193                 OutputDebugString(_T("Failed to retrieve 'alGenSources' function address\n"));
00194                 return AL_FALSE;
00195         }
00196         lpOALFnTable->alDeleteSources = (LPALDELETESOURCES)GetProcAddress(g_hOpenALDLL, "alDeleteSources");
00197         if (lpOALFnTable->alDeleteSources == NULL)
00198         {
00199                 OutputDebugString(_T("Failed to retrieve 'alDeleteSources' function address\n"));
00200                 return AL_FALSE;
00201         }
00202         lpOALFnTable->alIsSource = (LPALISSOURCE)GetProcAddress(g_hOpenALDLL, "alIsSource");
00203         if (lpOALFnTable->alIsSource == NULL)
00204         {
00205                 OutputDebugString(_T("Failed to retrieve 'alIsSource' function address\n"));
00206                 return AL_FALSE;
00207         }
00208         lpOALFnTable->alSourcei = (LPALSOURCEI)GetProcAddress(g_hOpenALDLL, "alSourcei");
00209         if (lpOALFnTable->alSourcei == NULL)
00210         {
00211                 OutputDebugString(_T("Failed to retrieve 'alSourcei' function address\n"));
00212                 return AL_FALSE;
00213         }
00214         lpOALFnTable->alSourcef = (LPALSOURCEF)GetProcAddress(g_hOpenALDLL, "alSourcef");
00215         if (lpOALFnTable->alSourcef == NULL)
00216         {
00217                 OutputDebugString(_T("Failed to retrieve 'alSourcef' function address\n"));
00218                 return AL_FALSE;
00219         }
00220         lpOALFnTable->alSource3f = (LPALSOURCE3F)GetProcAddress(g_hOpenALDLL, "alSource3f");
00221         if (lpOALFnTable->alSource3f == NULL)
00222         {
00223                 OutputDebugString(_T("Failed to retrieve 'alSource3f' function address\n"));
00224                 return AL_FALSE;
00225         }
00226         lpOALFnTable->alSourcefv = (LPALSOURCEFV)GetProcAddress(g_hOpenALDLL, "alSourcefv");
00227         if (lpOALFnTable->alSourcefv == NULL)
00228         {
00229                 OutputDebugString(_T("Failed to retrieve 'alSourcefv' function address\n"));
00230                 return AL_FALSE;
00231         }
00232         lpOALFnTable->alGetSourcei = (LPALGETSOURCEI)GetProcAddress(g_hOpenALDLL, "alGetSourcei");
00233         if (lpOALFnTable->alGetSourcei == NULL)
00234         {
00235                 OutputDebugString(_T("Failed to retrieve 'alGetSourcei' function address\n"));
00236                 return AL_FALSE;
00237         }
00238         lpOALFnTable->alGetSourcef = (LPALGETSOURCEF)GetProcAddress(g_hOpenALDLL, "alGetSourcef");
00239         if (lpOALFnTable->alGetSourcef == NULL)
00240         {
00241                 OutputDebugString(_T("Failed to retrieve 'alGetSourcef' function address\n"));
00242                 return AL_FALSE;
00243         }
00244         lpOALFnTable->alGetSourcefv = (LPALGETSOURCEFV)GetProcAddress(g_hOpenALDLL, "alGetSourcefv");
00245         if (lpOALFnTable->alGetSourcefv == NULL)
00246         {
00247                 OutputDebugString(_T("Failed to retrieve 'alGetSourcefv' function address\n"));
00248                 return AL_FALSE;
00249         }
00250         lpOALFnTable->alSourcePlayv = (LPALSOURCEPLAYV)GetProcAddress(g_hOpenALDLL, "alSourcePlayv");
00251         if (lpOALFnTable->alSourcePlayv == NULL)
00252         {
00253                 OutputDebugString(_T("Failed to retrieve 'alSourcePlayv' function address\n"));
00254                 return AL_FALSE;
00255         }
00256         lpOALFnTable->alSourceStopv = (LPALSOURCESTOPV)GetProcAddress(g_hOpenALDLL, "alSourceStopv");
00257         if (lpOALFnTable->alSourceStopv == NULL)
00258         {
00259                 OutputDebugString(_T("Failed to retrieve 'alSourceStopv' function address\n"));
00260                 return AL_FALSE;
00261         }
00262         lpOALFnTable->alSourcePlay = (LPALSOURCEPLAY)GetProcAddress(g_hOpenALDLL, "alSourcePlay");
00263         if (lpOALFnTable->alSourcePlay == NULL)
00264         {
00265                 OutputDebugString(_T("Failed to retrieve 'alSourcePlay' function address\n"));
00266                 return AL_FALSE;
00267         }
00268         lpOALFnTable->alSourcePause = (LPALSOURCEPAUSE)GetProcAddress(g_hOpenALDLL, "alSourcePause");
00269         if (lpOALFnTable->alSourcePause == NULL)
00270         {
00271                 OutputDebugString(_T("Failed to retrieve 'alSourcePause' function address\n"));
00272                 return AL_FALSE;
00273         }
00274         lpOALFnTable->alSourceStop = (LPALSOURCESTOP)GetProcAddress(g_hOpenALDLL, "alSourceStop");
00275         if (lpOALFnTable->alSourceStop == NULL)
00276         {
00277                 OutputDebugString(_T("Failed to retrieve 'alSourceStop' function address\n"));
00278                 return AL_FALSE;
00279         }
00280         lpOALFnTable->alGenBuffers = (LPALGENBUFFERS)GetProcAddress(g_hOpenALDLL, "alGenBuffers");
00281         if (lpOALFnTable->alGenBuffers == NULL)
00282         {
00283                 OutputDebugString(_T("Failed to retrieve 'alGenBuffers' function address\n"));
00284                 return AL_FALSE;
00285         }
00286         lpOALFnTable->alDeleteBuffers = (LPALDELETEBUFFERS)GetProcAddress(g_hOpenALDLL, "alDeleteBuffers");
00287         if (lpOALFnTable->alDeleteBuffers == NULL)
00288         {
00289                 OutputDebugString(_T("Failed to retrieve 'alDeleteBuffers' function address\n"));
00290                 return AL_FALSE;
00291         }
00292         lpOALFnTable->alIsBuffer = (LPALISBUFFER)GetProcAddress(g_hOpenALDLL, "alIsBuffer");
00293         if (lpOALFnTable->alIsBuffer == NULL)
00294         {
00295                 OutputDebugString(_T("Failed to retrieve 'alIsBuffer' function address\n"));
00296                 return AL_FALSE;
00297         }
00298         lpOALFnTable->alBufferData = (LPALBUFFERDATA)GetProcAddress(g_hOpenALDLL, "alBufferData");
00299         if (lpOALFnTable->alBufferData == NULL)
00300         {
00301                 OutputDebugString(_T("Failed to retrieve 'alBufferData' function address\n"));
00302                 return AL_FALSE;
00303         }
00304         lpOALFnTable->alGetBufferi = (LPALGETBUFFERI)GetProcAddress(g_hOpenALDLL, "alGetBufferi");
00305         if (lpOALFnTable->alGetBufferi == NULL)
00306         {
00307                 OutputDebugString(_T("Failed to retrieve 'alGetBufferi' function address\n"));
00308                 return AL_FALSE;
00309         }
00310         lpOALFnTable->alGetBufferf = (LPALGETBUFFERF)GetProcAddress(g_hOpenALDLL, "alGetBufferf");
00311         if (lpOALFnTable->alGetBufferf == NULL)
00312         {
00313                 OutputDebugString(_T("Failed to retrieve 'alGetBufferf' function address\n"));
00314                 return AL_FALSE;
00315         }
00316         lpOALFnTable->alSourceQueueBuffers = (LPALSOURCEQUEUEBUFFERS)GetProcAddress(g_hOpenALDLL, "alSourceQueueBuffers");
00317         if (lpOALFnTable->alSourceQueueBuffers == NULL)
00318         {
00319                 OutputDebugString(_T("Failed to retrieve 'alSourceQueueBuffers' function address\n"));
00320                 return AL_FALSE;
00321         }
00322         lpOALFnTable->alSourceUnqueueBuffers = (LPALSOURCEUNQUEUEBUFFERS)GetProcAddress(g_hOpenALDLL, "alSourceUnqueueBuffers");
00323         if (lpOALFnTable->alSourceUnqueueBuffers == NULL)
00324         {
00325                 OutputDebugString(_T("Failed to retrieve 'alSourceUnqueueBuffers' function address\n"));
00326                 return AL_FALSE;
00327         }
00328         lpOALFnTable->alDistanceModel = (LPALDISTANCEMODEL)GetProcAddress(g_hOpenALDLL, "alDistanceModel");
00329         if (lpOALFnTable->alDistanceModel == NULL)
00330         {
00331                 OutputDebugString(_T("Failed to retrieve 'alDistanceModel' function address\n"));
00332                 return AL_FALSE;
00333         }
00334         lpOALFnTable->alDopplerFactor = (LPALDOPPLERFACTOR)GetProcAddress(g_hOpenALDLL, "alDopplerFactor");
00335         if (lpOALFnTable->alDopplerFactor == NULL)
00336         {
00337                 OutputDebugString(_T("Failed to retrieve 'alDopplerFactor' function address\n"));
00338                 return AL_FALSE;
00339         }
00340         lpOALFnTable->alDopplerVelocity = (LPALDOPPLERVELOCITY)GetProcAddress(g_hOpenALDLL, "alDopplerVelocity");
00341         if (lpOALFnTable->alDopplerVelocity == NULL)
00342         {
00343                 OutputDebugString(_T("Failed to retrieve 'alDopplerVelocity' function address\n"));
00344                 return AL_FALSE;
00345         }
00346         lpOALFnTable->alcGetString = (LPALCGETSTRING)GetProcAddress(g_hOpenALDLL, "alcGetString");
00347         if (lpOALFnTable->alcGetString == NULL)
00348         {
00349                 OutputDebugString(_T("Failed to retrieve 'alcGetString' function address\n"));
00350                 return AL_FALSE;
00351         }
00352         lpOALFnTable->alcGetIntegerv = (LPALCGETINTEGERV)GetProcAddress(g_hOpenALDLL, "alcGetIntegerv");
00353         if (lpOALFnTable->alcGetIntegerv == NULL)
00354         {
00355                 OutputDebugString(_T("Failed to retrieve 'alcGetIntegerv' function address\n"));
00356                 return AL_FALSE;
00357         }
00358         lpOALFnTable->alcOpenDevice = (LPALCOPENDEVICE)GetProcAddress(g_hOpenALDLL, "alcOpenDevice");
00359         if (lpOALFnTable->alcOpenDevice == NULL)
00360         {
00361                 OutputDebugString(_T("Failed to retrieve 'alcOpenDevice' function address\n"));
00362                 return AL_FALSE;
00363         }
00364         lpOALFnTable->alcCloseDevice = (LPALCCLOSEDEVICE)GetProcAddress(g_hOpenALDLL, "alcCloseDevice");
00365         if (lpOALFnTable->alcCloseDevice == NULL)
00366         {
00367                 OutputDebugString(_T("Failed to retrieve 'alcCloseDevice' function address\n"));
00368                 return AL_FALSE;
00369         }
00370         lpOALFnTable->alcCreateContext = (LPALCCREATECONTEXT)GetProcAddress(g_hOpenALDLL, "alcCreateContext");
00371         if (lpOALFnTable->alcCreateContext == NULL)
00372         {
00373                 OutputDebugString(_T("Failed to retrieve 'alcCreateContext' function address\n"));
00374                 return AL_FALSE;
00375         }
00376         lpOALFnTable->alcMakeContextCurrent = (LPALCMAKECONTEXTCURRENT)GetProcAddress(g_hOpenALDLL, "alcMakeContextCurrent");
00377         if (lpOALFnTable->alcMakeContextCurrent == NULL)
00378         {
00379                 OutputDebugString(_T("Failed to retrieve 'alcMakeContextCurrent' function address\n"));
00380                 return AL_FALSE;
00381         }
00382         lpOALFnTable->alcProcessContext = (LPALCPROCESSCONTEXT)GetProcAddress(g_hOpenALDLL, "alcProcessContext");
00383         if (lpOALFnTable->alcProcessContext == NULL)
00384         {
00385                 OutputDebugString(_T("Failed to retrieve 'alcProcessContext' function address\n"));
00386                 return AL_FALSE;
00387         }
00388         lpOALFnTable->alcGetCurrentContext = (LPALCGETCURRENTCONTEXT)GetProcAddress(g_hOpenALDLL, "alcGetCurrentContext");
00389         if (lpOALFnTable->alcGetCurrentContext == NULL)
00390         {
00391                 OutputDebugString(_T("Failed to retrieve 'alcGetCurrentContext' function address\n"));
00392                 return AL_FALSE;
00393         }
00394         lpOALFnTable->alcGetContextsDevice = (LPALCGETCONTEXTSDEVICE)GetProcAddress(g_hOpenALDLL, "alcGetContextsDevice");
00395         if (lpOALFnTable->alcGetContextsDevice == NULL)
00396         {
00397                 OutputDebugString(_T("Failed to retrieve 'alcGetContextsDevice' function address\n"));
00398                 return AL_FALSE;
00399         }
00400         lpOALFnTable->alcSuspendContext = (LPALCSUSPENDCONTEXT)GetProcAddress(g_hOpenALDLL, "alcSuspendContext");
00401         if (lpOALFnTable->alcSuspendContext == NULL)
00402         {
00403                 OutputDebugString(_T("Failed to retrieve 'alcSuspendContext' function address\n"));
00404                 return AL_FALSE;
00405         }
00406         lpOALFnTable->alcDestroyContext = (LPALCDESTROYCONTEXT)GetProcAddress(g_hOpenALDLL, "alcDestroyContext");
00407         if (lpOALFnTable->alcDestroyContext == NULL)
00408         {
00409                 OutputDebugString(_T("Failed to retrieve 'alcDestroyContext' function address\n"));
00410                 return AL_FALSE;
00411         }
00412         lpOALFnTable->alcGetError = (LPALCGETERROR)GetProcAddress(g_hOpenALDLL, "alcGetError");
00413         if (lpOALFnTable->alcGetError == NULL)
00414         {
00415                 OutputDebugString(_T("Failed to retrieve 'alcGetError' function address\n"));
00416                 return AL_FALSE;
00417         }
00418         lpOALFnTable->alcIsExtensionPresent = (LPALCISEXTENSIONPRESENT)GetProcAddress(g_hOpenALDLL, "alcIsExtensionPresent");
00419         if (lpOALFnTable->alcIsExtensionPresent == NULL)
00420         {
00421                 OutputDebugString(_T("Failed to retrieve 'alcIsExtensionPresent' function address\n"));
00422                 return AL_FALSE;
00423         }
00424         lpOALFnTable->alcGetProcAddress = (LPALCGETPROCADDRESS)GetProcAddress(g_hOpenALDLL, "alcGetProcAddress");
00425         if (lpOALFnTable->alcGetProcAddress == NULL)
00426         {
00427                 OutputDebugString(_T("Failed to retrieve 'alcGetProcAddress' function address\n"));
00428                 return AL_FALSE;
00429         }
00430         lpOALFnTable->alcGetEnumValue = (LPALCGETENUMVALUE)GetProcAddress(g_hOpenALDLL, "alcGetEnumValue");
00431         if (lpOALFnTable->alcGetEnumValue == NULL)
00432         {
00433                 OutputDebugString(_T("Failed to retrieve 'alcGetEnumValue' function address\n"));
00434                 return AL_FALSE;
00435         }
00436 
00437         return AL_TRUE;
00438 }
00439 
00440 ALvoid UnloadOAL10Library()
00441 {
00442         // Unload the dll
00443         if (g_hOpenALDLL)
00444         {
00445                 FreeLibrary(g_hOpenALDLL);
00446                 g_hOpenALDLL = NULL;
00447         }
00448 }

Generated on Fri Jun 18 2010 17:48:39 for Cannonball by  doxygen 1.7.0