LoadOAL.cpp
Engine/source/sfx/openal/win32/LoadOAL.cpp
Public Variables
HINSTANCE
Public Functions
ALboolean
LoadOAL10Library(char * szOALFullPathName, LPOPENALFNTABLE lpOALFnTable)
ALvoid
Detailed Description
Public Variables
HINSTANCE g_hOpenALDLL
Public Functions
LoadOAL10Library(char * szOALFullPathName, LPOPENALFNTABLE lpOALFnTable)
UnloadOAL10Library()
1 2/* 3 * Copyright (c) 2006, Creative Labs Inc. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without modification, are permitted provided 7 * that the following conditions are met: 8 * 9 * * Redistributions of source code must retain the above copyright notice, this list of conditions and 10 * the following disclaimer. 11 * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions 12 * and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 * * Neither the name of Creative Labs Inc. nor the names of its contributors may be used to endorse or 14 * promote products derived from this software without specific prior written permission. 15 * 16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 20 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 22 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 23 * POSSIBILITY OF SUCH DAMAGE. 24 */ 25 26#include <windows.h> 27#include "sfx/openal/LoadOAL.h" 28 29HINSTANCE g_hOpenALDLL = NULL; 30 31ALboolean LoadOAL10Library(char *szOALFullPathName, LPOPENALFNTABLE lpOALFnTable) 32{ 33 if (!lpOALFnTable) 34 return AL_FALSE; 35 36 if (szOALFullPathName) 37 g_hOpenALDLL = LoadLibraryA(szOALFullPathName); 38 else 39 g_hOpenALDLL = LoadLibraryA("openal32.dll"); 40 41 if (!g_hOpenALDLL) 42 return AL_FALSE; 43 44 memset(lpOALFnTable, 0, sizeof(OPENALFNTABLE)); 45 46 // Get function pointers 47 lpOALFnTable->alEnable = (LPALENABLE)GetProcAddress(g_hOpenALDLL, "alEnable"); 48 if (lpOALFnTable->alEnable == NULL) 49 { 50 OutputDebugStringA("Failed to retrieve 'alEnable' function address\n"); 51 return AL_FALSE; 52 } 53 lpOALFnTable->alDisable = (LPALDISABLE)GetProcAddress(g_hOpenALDLL, "alDisable"); 54 if (lpOALFnTable->alDisable == NULL) 55 { 56 OutputDebugStringA("Failed to retrieve 'alDisable' function address\n"); 57 return AL_FALSE; 58 } 59 lpOALFnTable->alIsEnabled = (LPALISENABLED)GetProcAddress(g_hOpenALDLL, "alIsEnabled"); 60 if (lpOALFnTable->alIsEnabled == NULL) 61 { 62 OutputDebugStringA("Failed to retrieve 'alIsEnabled' function address\n"); 63 return AL_FALSE; 64 } 65 lpOALFnTable->alGetBoolean = (LPALGETBOOLEAN)GetProcAddress(g_hOpenALDLL, "alGetBoolean"); 66 if (lpOALFnTable->alGetBoolean == NULL) 67 { 68 OutputDebugStringA("Failed to retrieve 'alGetBoolean' function address\n"); 69 return AL_FALSE; 70 } 71 lpOALFnTable->alGetInteger = (LPALGETINTEGER)GetProcAddress(g_hOpenALDLL, "alGetInteger"); 72 if (lpOALFnTable->alGetInteger == NULL) 73 { 74 OutputDebugStringA("Failed to retrieve 'alGetInteger' function address\n"); 75 return AL_FALSE; 76 } 77 lpOALFnTable->alGetFloat = (LPALGETFLOAT)GetProcAddress(g_hOpenALDLL, "alGetFloat"); 78 if (lpOALFnTable->alGetFloat == NULL) 79 { 80 OutputDebugStringA("Failed to retrieve 'alGetFloat' function address\n"); 81 return AL_FALSE; 82 } 83 lpOALFnTable->alGetDouble = (LPALGETDOUBLE)GetProcAddress(g_hOpenALDLL, "alGetDouble"); 84 if (lpOALFnTable->alGetDouble == NULL) 85 { 86 OutputDebugStringA("Failed to retrieve 'alGetDouble' function address\n"); 87 return AL_FALSE; 88 } 89 lpOALFnTable->alGetBooleanv = (LPALGETBOOLEANV)GetProcAddress(g_hOpenALDLL, "alGetBooleanv"); 90 if (lpOALFnTable->alGetBooleanv == NULL) 91 { 92 OutputDebugStringA("Failed to retrieve 'alGetBooleanv' function address\n"); 93 return AL_FALSE; 94 } 95 lpOALFnTable->alGetIntegerv = (LPALGETINTEGERV)GetProcAddress(g_hOpenALDLL, "alGetIntegerv"); 96 if (lpOALFnTable->alGetIntegerv == NULL) 97 { 98 OutputDebugStringA("Failed to retrieve 'alGetIntegerv' function address\n"); 99 return AL_FALSE; 100 } 101 lpOALFnTable->alGetFloatv = (LPALGETFLOATV)GetProcAddress(g_hOpenALDLL, "alGetFloatv"); 102 if (lpOALFnTable->alGetFloatv == NULL) 103 { 104 OutputDebugStringA("Failed to retrieve 'alGetFloatv' function address\n"); 105 return AL_FALSE; 106 } 107 lpOALFnTable->alGetDoublev = (LPALGETDOUBLEV)GetProcAddress(g_hOpenALDLL, "alGetDoublev"); 108 if (lpOALFnTable->alGetDoublev == NULL) 109 { 110 OutputDebugStringA("Failed to retrieve 'alGetDoublev' function address\n"); 111 return AL_FALSE; 112 } 113 lpOALFnTable->alGetString = (LPALGETSTRING)GetProcAddress(g_hOpenALDLL, "alGetString"); 114 if (lpOALFnTable->alGetString == NULL) 115 { 116 OutputDebugStringA("Failed to retrieve 'alGetString' function address\n"); 117 return AL_FALSE; 118 } 119 lpOALFnTable->alGetError = (LPALGETERROR)GetProcAddress(g_hOpenALDLL, "alGetError"); 120 if (lpOALFnTable->alGetError == NULL) 121 { 122 OutputDebugStringA("Failed to retrieve 'alGetError' function address\n"); 123 return AL_FALSE; 124 } 125 lpOALFnTable->alIsExtensionPresent = (LPALISEXTENSIONPRESENT)GetProcAddress(g_hOpenALDLL, "alIsExtensionPresent"); 126 if (lpOALFnTable->alIsExtensionPresent == NULL) 127 { 128 OutputDebugStringA("Failed to retrieve 'alIsExtensionPresent' function address\n"); 129 return AL_FALSE; 130 } 131 lpOALFnTable->alGetProcAddress = (LPALGETPROCADDRESS)GetProcAddress(g_hOpenALDLL, "alGetProcAddress"); 132 if (lpOALFnTable->alGetProcAddress == NULL) 133 { 134 OutputDebugStringA("Failed to retrieve 'alGetProcAddress' function address\n"); 135 return AL_FALSE; 136 } 137 lpOALFnTable->alGetEnumValue = (LPALGETENUMVALUE)GetProcAddress(g_hOpenALDLL, "alGetEnumValue"); 138 if (lpOALFnTable->alGetEnumValue == NULL) 139 { 140 OutputDebugStringA("Failed to retrieve 'alGetEnumValue' function address\n"); 141 return AL_FALSE; 142 } 143 lpOALFnTable->alListeneri = (LPALLISTENERI)GetProcAddress(g_hOpenALDLL, "alListeneri"); 144 if (lpOALFnTable->alListeneri == NULL) 145 { 146 OutputDebugStringA("Failed to retrieve 'alListeneri' function address\n"); 147 return AL_FALSE; 148 } 149 lpOALFnTable->alListenerf = (LPALLISTENERF)GetProcAddress(g_hOpenALDLL, "alListenerf"); 150 if (lpOALFnTable->alListenerf == NULL) 151 { 152 OutputDebugStringA("Failed to retrieve 'alListenerf' function address\n"); 153 return AL_FALSE; 154 } 155 lpOALFnTable->alListener3f = (LPALLISTENER3F)GetProcAddress(g_hOpenALDLL, "alListener3f"); 156 if (lpOALFnTable->alListener3f == NULL) 157 { 158 OutputDebugStringA("Failed to retrieve 'alListener3f' function address\n"); 159 return AL_FALSE; 160 } 161 lpOALFnTable->alListenerfv = (LPALLISTENERFV)GetProcAddress(g_hOpenALDLL, "alListenerfv"); 162 if (lpOALFnTable->alListenerfv == NULL) 163 { 164 OutputDebugStringA("Failed to retrieve 'alListenerfv' function address\n"); 165 return AL_FALSE; 166 } 167 lpOALFnTable->alGetListeneri = (LPALGETLISTENERI)GetProcAddress(g_hOpenALDLL, "alGetListeneri"); 168 if (lpOALFnTable->alGetListeneri == NULL) 169 { 170 OutputDebugStringA("Failed to retrieve 'alGetListeneri' function address\n"); 171 return AL_FALSE; 172 } 173 lpOALFnTable->alGetListenerf =(LPALGETLISTENERF)GetProcAddress(g_hOpenALDLL, "alGetListenerf"); 174 if (lpOALFnTable->alGetListenerf == NULL) 175 { 176 OutputDebugStringA("Failed to retrieve 'alGetListenerf' function address\n"); 177 return AL_FALSE; 178 } 179 lpOALFnTable->alGetListener3f = (LPALGETLISTENER3F)GetProcAddress(g_hOpenALDLL, "alGetListener3f"); 180 if (lpOALFnTable->alGetListener3f == NULL) 181 { 182 OutputDebugStringA("Failed to retrieve 'alGetListener3f' function address\n"); 183 return AL_FALSE; 184 } 185 lpOALFnTable->alGetListenerfv = (LPALGETLISTENERFV)GetProcAddress(g_hOpenALDLL, "alGetListenerfv"); 186 if (lpOALFnTable->alGetListenerfv == NULL) 187 { 188 OutputDebugStringA("Failed to retrieve 'alGetListenerfv' function address\n"); 189 return AL_FALSE; 190 } 191 lpOALFnTable->alGenSources = (LPALGENSOURCES)GetProcAddress(g_hOpenALDLL, "alGenSources"); 192 if (lpOALFnTable->alGenSources == NULL) 193 { 194 OutputDebugStringA("Failed to retrieve 'alGenSources' function address\n"); 195 return AL_FALSE; 196 } 197 lpOALFnTable->alDeleteSources = (LPALDELETESOURCES)GetProcAddress(g_hOpenALDLL, "alDeleteSources"); 198 if (lpOALFnTable->alDeleteSources == NULL) 199 { 200 OutputDebugStringA("Failed to retrieve 'alDeleteSources' function address\n"); 201 return AL_FALSE; 202 } 203 lpOALFnTable->alIsSource = (LPALISSOURCE)GetProcAddress(g_hOpenALDLL, "alIsSource"); 204 if (lpOALFnTable->alIsSource == NULL) 205 { 206 OutputDebugStringA("Failed to retrieve 'alIsSource' function address\n"); 207 return AL_FALSE; 208 } 209 lpOALFnTable->alSourcei = (LPALSOURCEI)GetProcAddress(g_hOpenALDLL, "alSourcei"); 210 if (lpOALFnTable->alSourcei == NULL) 211 { 212 OutputDebugStringA("Failed to retrieve 'alSourcei' function address\n"); 213 return AL_FALSE; 214 } 215 lpOALFnTable->alSourcef = (LPALSOURCEF)GetProcAddress(g_hOpenALDLL, "alSourcef"); 216 if (lpOALFnTable->alSourcef == NULL) 217 { 218 OutputDebugStringA("Failed to retrieve 'alSourcef' function address\n"); 219 return AL_FALSE; 220 } 221 lpOALFnTable->alSource3f = (LPALSOURCE3F)GetProcAddress(g_hOpenALDLL, "alSource3f"); 222 if (lpOALFnTable->alSource3f == NULL) 223 { 224 OutputDebugStringA("Failed to retrieve 'alSource3f' function address\n"); 225 return AL_FALSE; 226 } 227 lpOALFnTable->alSourcefv = (LPALSOURCEFV)GetProcAddress(g_hOpenALDLL, "alSourcefv"); 228 if (lpOALFnTable->alSourcefv == NULL) 229 { 230 OutputDebugStringA("Failed to retrieve 'alSourcefv' function address\n"); 231 return AL_FALSE; 232 } 233 lpOALFnTable->alGetSourcei = (LPALGETSOURCEI)GetProcAddress(g_hOpenALDLL, "alGetSourcei"); 234 if (lpOALFnTable->alGetSourcei == NULL) 235 { 236 OutputDebugStringA("Failed to retrieve 'alGetSourcei' function address\n"); 237 return AL_FALSE; 238 } 239 lpOALFnTable->alGetSourcef = (LPALGETSOURCEF)GetProcAddress(g_hOpenALDLL, "alGetSourcef"); 240 if (lpOALFnTable->alGetSourcef == NULL) 241 { 242 OutputDebugStringA("Failed to retrieve 'alGetSourcef' function address\n"); 243 return AL_FALSE; 244 } 245 lpOALFnTable->alGetSourcefv = (LPALGETSOURCEFV)GetProcAddress(g_hOpenALDLL, "alGetSourcefv"); 246 if (lpOALFnTable->alGetSourcefv == NULL) 247 { 248 OutputDebugStringA("Failed to retrieve 'alGetSourcefv' function address\n"); 249 return AL_FALSE; 250 } 251 lpOALFnTable->alSourcePlayv = (LPALSOURCEPLAYV)GetProcAddress(g_hOpenALDLL, "alSourcePlayv"); 252 if (lpOALFnTable->alSourcePlayv == NULL) 253 { 254 OutputDebugStringA("Failed to retrieve 'alSourcePlayv' function address\n"); 255 return AL_FALSE; 256 } 257 lpOALFnTable->alSourceStopv = (LPALSOURCESTOPV)GetProcAddress(g_hOpenALDLL, "alSourceStopv"); 258 if (lpOALFnTable->alSourceStopv == NULL) 259 { 260 OutputDebugStringA("Failed to retrieve 'alSourceStopv' function address\n"); 261 return AL_FALSE; 262 } 263 lpOALFnTable->alSourcePlay = (LPALSOURCEPLAY)GetProcAddress(g_hOpenALDLL, "alSourcePlay"); 264 if (lpOALFnTable->alSourcePlay == NULL) 265 { 266 OutputDebugStringA("Failed to retrieve 'alSourcePlay' function address\n"); 267 return AL_FALSE; 268 } 269 lpOALFnTable->alSourcePause = (LPALSOURCEPAUSE)GetProcAddress(g_hOpenALDLL, "alSourcePause"); 270 if (lpOALFnTable->alSourcePause == NULL) 271 { 272 OutputDebugStringA("Failed to retrieve 'alSourcePause' function address\n"); 273 return AL_FALSE; 274 } 275 lpOALFnTable->alSourceStop = (LPALSOURCESTOP)GetProcAddress(g_hOpenALDLL, "alSourceStop"); 276 if (lpOALFnTable->alSourceStop == NULL) 277 { 278 OutputDebugStringA("Failed to retrieve 'alSourceStop' function address\n"); 279 return AL_FALSE; 280 } 281 lpOALFnTable->alSourceRewind = (LPALSOURCEREWIND)GetProcAddress(g_hOpenALDLL, "alSourceRewind"); 282 if (lpOALFnTable->alSourceRewind == NULL) 283 { 284 OutputDebugStringA("Failed to retrieve 'alSourceRewind' function address\n"); 285 return AL_FALSE; 286 } 287 lpOALFnTable->alGenBuffers = (LPALGENBUFFERS)GetProcAddress(g_hOpenALDLL, "alGenBuffers"); 288 if (lpOALFnTable->alGenBuffers == NULL) 289 { 290 OutputDebugStringA("Failed to retrieve 'alGenBuffers' function address\n"); 291 return AL_FALSE; 292 } 293 lpOALFnTable->alDeleteBuffers = (LPALDELETEBUFFERS)GetProcAddress(g_hOpenALDLL, "alDeleteBuffers"); 294 if (lpOALFnTable->alDeleteBuffers == NULL) 295 { 296 OutputDebugStringA("Failed to retrieve 'alDeleteBuffers' function address\n"); 297 return AL_FALSE; 298 } 299 lpOALFnTable->alIsBuffer = (LPALISBUFFER)GetProcAddress(g_hOpenALDLL, "alIsBuffer"); 300 if (lpOALFnTable->alIsBuffer == NULL) 301 { 302 OutputDebugStringA("Failed to retrieve 'alIsBuffer' function address\n"); 303 return AL_FALSE; 304 } 305 lpOALFnTable->alBufferData = (LPALBUFFERDATA)GetProcAddress(g_hOpenALDLL, "alBufferData"); 306 if (lpOALFnTable->alBufferData == NULL) 307 { 308 OutputDebugStringA("Failed to retrieve 'alBufferData' function address\n"); 309 return AL_FALSE; 310 } 311 lpOALFnTable->alGetBufferi = (LPALGETBUFFERI)GetProcAddress(g_hOpenALDLL, "alGetBufferi"); 312 if (lpOALFnTable->alGetBufferi == NULL) 313 { 314 OutputDebugStringA("Failed to retrieve 'alGetBufferi' function address\n"); 315 return AL_FALSE; 316 } 317 lpOALFnTable->alGetBufferf = (LPALGETBUFFERF)GetProcAddress(g_hOpenALDLL, "alGetBufferf"); 318 if (lpOALFnTable->alGetBufferf == NULL) 319 { 320 OutputDebugStringA("Failed to retrieve 'alGetBufferf' function address\n"); 321 return AL_FALSE; 322 } 323 lpOALFnTable->alSourceQueueBuffers = (LPALSOURCEQUEUEBUFFERS)GetProcAddress(g_hOpenALDLL, "alSourceQueueBuffers"); 324 if (lpOALFnTable->alSourceQueueBuffers == NULL) 325 { 326 OutputDebugStringA("Failed to retrieve 'alSourceQueueBuffers' function address\n"); 327 return AL_FALSE; 328 } 329 lpOALFnTable->alSourceUnqueueBuffers = (LPALSOURCEUNQUEUEBUFFERS)GetProcAddress(g_hOpenALDLL, "alSourceUnqueueBuffers"); 330 if (lpOALFnTable->alSourceUnqueueBuffers == NULL) 331 { 332 OutputDebugStringA("Failed to retrieve 'alSourceUnqueueBuffers' function address\n"); 333 return AL_FALSE; 334 } 335 lpOALFnTable->alDistanceModel = (LPALDISTANCEMODEL)GetProcAddress(g_hOpenALDLL, "alDistanceModel"); 336 if (lpOALFnTable->alDistanceModel == NULL) 337 { 338 OutputDebugStringA("Failed to retrieve 'alDistanceModel' function address\n"); 339 return AL_FALSE; 340 } 341 lpOALFnTable->alDopplerFactor = (LPALDOPPLERFACTOR)GetProcAddress(g_hOpenALDLL, "alDopplerFactor"); 342 if (lpOALFnTable->alDopplerFactor == NULL) 343 { 344 OutputDebugStringA("Failed to retrieve 'alDopplerFactor' function address\n"); 345 return AL_FALSE; 346 } 347 lpOALFnTable->alDopplerVelocity = (LPALDOPPLERVELOCITY)GetProcAddress(g_hOpenALDLL, "alDopplerVelocity"); 348 if (lpOALFnTable->alDopplerVelocity == NULL) 349 { 350 OutputDebugStringA("Failed to retrieve 'alDopplerVelocity' function address\n"); 351 return AL_FALSE; 352 } 353 lpOALFnTable->alcGetString = (LPALCGETSTRING)GetProcAddress(g_hOpenALDLL, "alcGetString"); 354 if (lpOALFnTable->alcGetString == NULL) 355 { 356 OutputDebugStringA("Failed to retrieve 'alcGetString' function address\n"); 357 return AL_FALSE; 358 } 359 lpOALFnTable->alcGetIntegerv = (LPALCGETINTEGERV)GetProcAddress(g_hOpenALDLL, "alcGetIntegerv"); 360 if (lpOALFnTable->alcGetIntegerv == NULL) 361 { 362 OutputDebugStringA("Failed to retrieve 'alcGetIntegerv' function address\n"); 363 return AL_FALSE; 364 } 365 lpOALFnTable->alcOpenDevice = (LPALCOPENDEVICE)GetProcAddress(g_hOpenALDLL, "alcOpenDevice"); 366 if (lpOALFnTable->alcOpenDevice == NULL) 367 { 368 OutputDebugStringA("Failed to retrieve 'alcOpenDevice' function address\n"); 369 return AL_FALSE; 370 } 371 lpOALFnTable->alcCloseDevice = (LPALCCLOSEDEVICE)GetProcAddress(g_hOpenALDLL, "alcCloseDevice"); 372 if (lpOALFnTable->alcCloseDevice == NULL) 373 { 374 OutputDebugStringA("Failed to retrieve 'alcCloseDevice' function address\n"); 375 return AL_FALSE; 376 } 377 lpOALFnTable->alcCreateContext = (LPALCCREATECONTEXT)GetProcAddress(g_hOpenALDLL, "alcCreateContext"); 378 if (lpOALFnTable->alcCreateContext == NULL) 379 { 380 OutputDebugStringA("Failed to retrieve 'alcCreateContext' function address\n"); 381 return AL_FALSE; 382 } 383 lpOALFnTable->alcMakeContextCurrent = (LPALCMAKECONTEXTCURRENT)GetProcAddress(g_hOpenALDLL, "alcMakeContextCurrent"); 384 if (lpOALFnTable->alcMakeContextCurrent == NULL) 385 { 386 OutputDebugStringA("Failed to retrieve 'alcMakeContextCurrent' function address\n"); 387 return AL_FALSE; 388 } 389 lpOALFnTable->alcProcessContext = (LPALCPROCESSCONTEXT)GetProcAddress(g_hOpenALDLL, "alcProcessContext"); 390 if (lpOALFnTable->alcProcessContext == NULL) 391 { 392 OutputDebugStringA("Failed to retrieve 'alcProcessContext' function address\n"); 393 return AL_FALSE; 394 } 395 lpOALFnTable->alcGetCurrentContext = (LPALCGETCURRENTCONTEXT)GetProcAddress(g_hOpenALDLL, "alcGetCurrentContext"); 396 if (lpOALFnTable->alcGetCurrentContext == NULL) 397 { 398 OutputDebugStringA("Failed to retrieve 'alcGetCurrentContext' function address\n"); 399 return AL_FALSE; 400 } 401 lpOALFnTable->alcGetContextsDevice = (LPALCGETCONTEXTSDEVICE)GetProcAddress(g_hOpenALDLL, "alcGetContextsDevice"); 402 if (lpOALFnTable->alcGetContextsDevice == NULL) 403 { 404 OutputDebugStringA("Failed to retrieve 'alcGetContextsDevice' function address\n"); 405 return AL_FALSE; 406 } 407 lpOALFnTable->alcSuspendContext = (LPALCSUSPENDCONTEXT)GetProcAddress(g_hOpenALDLL, "alcSuspendContext"); 408 if (lpOALFnTable->alcSuspendContext == NULL) 409 { 410 OutputDebugStringA("Failed to retrieve 'alcSuspendContext' function address\n"); 411 return AL_FALSE; 412 } 413 lpOALFnTable->alcDestroyContext = (LPALCDESTROYCONTEXT)GetProcAddress(g_hOpenALDLL, "alcDestroyContext"); 414 if (lpOALFnTable->alcDestroyContext == NULL) 415 { 416 OutputDebugStringA("Failed to retrieve 'alcDestroyContext' function address\n"); 417 return AL_FALSE; 418 } 419 lpOALFnTable->alcGetError = (LPALCGETERROR)GetProcAddress(g_hOpenALDLL, "alcGetError"); 420 if (lpOALFnTable->alcGetError == NULL) 421 { 422 OutputDebugStringA("Failed to retrieve 'alcGetError' function address\n"); 423 return AL_FALSE; 424 } 425 lpOALFnTable->alcIsExtensionPresent = (LPALCISEXTENSIONPRESENT)GetProcAddress(g_hOpenALDLL, "alcIsExtensionPresent"); 426 if (lpOALFnTable->alcIsExtensionPresent == NULL) 427 { 428 OutputDebugStringA("Failed to retrieve 'alcIsExtensionPresent' function address\n"); 429 return AL_FALSE; 430 } 431 lpOALFnTable->alcGetProcAddress = (LPALCGETPROCADDRESS)GetProcAddress(g_hOpenALDLL, "alcGetProcAddress"); 432 if (lpOALFnTable->alcGetProcAddress == NULL) 433 { 434 OutputDebugStringA("Failed to retrieve 'alcGetProcAddress' function address\n"); 435 return AL_FALSE; 436 } 437 lpOALFnTable->alcGetEnumValue = (LPALCGETENUMVALUE)GetProcAddress(g_hOpenALDLL, "alcGetEnumValue"); 438 if (lpOALFnTable->alcGetEnumValue == NULL) 439 { 440 OutputDebugStringA("Failed to retrieve 'alcGetEnumValue' function address\n"); 441 return AL_FALSE; 442 } 443#if defined(AL_ALEXT_PROTOTYPES) 444 lpOALFnTable->alGenEffects = (LPALGENEFFECTS)GetProcAddress(g_hOpenALDLL, "alGenEffects"); 445 if (lpOALFnTable->alGenEffects == NULL) 446 { 447 OutputDebugStringA("Failed to retrieve 'alGenEffects' function address\n"); 448 } 449 lpOALFnTable->alEffecti = (LPALEFFECTI)GetProcAddress(g_hOpenALDLL, "alEffecti"); 450 if (lpOALFnTable->alEffecti == NULL) 451 { 452 OutputDebugStringA("Failed to retrieve 'alEffecti' function address\n"); 453 } 454 lpOALFnTable->alEffectiv = (LPALEFFECTIV)GetProcAddress(g_hOpenALDLL, "alEffectiv"); 455 if (lpOALFnTable->alEffectiv == NULL) 456 { 457 OutputDebugStringA("Failed to retrieve 'alEffectiv' function address\n"); 458 } 459 lpOALFnTable->alEffectf = (LPALEFFECTF)GetProcAddress(g_hOpenALDLL, "alEffectf"); 460 if (lpOALFnTable->alEffectf == NULL) 461 { 462 OutputDebugStringA("Failed to retrieve 'alEffectf' function address\n"); 463 } 464 lpOALFnTable->alEffectfv = (LPALEFFECTFV)GetProcAddress(g_hOpenALDLL, "alEffectfv"); 465 if (lpOALFnTable->alEffectfv == NULL) 466 { 467 OutputDebugStringA("Failed to retrieve 'alEffectfv' function address\n"); 468 } 469 lpOALFnTable->alGetEffecti = (LPALGETEFFECTI)GetProcAddress(g_hOpenALDLL, "alGetEffecti"); 470 if (lpOALFnTable->alGetEffecti == NULL) 471 { 472 OutputDebugStringA("Failed to retrieve 'alGetEffecti' function address\n"); 473 } 474 lpOALFnTable->alGetEffectiv = (LPALGETEFFECTIV)GetProcAddress(g_hOpenALDLL, "alGetEffectiv"); 475 if (lpOALFnTable->alGetEffectiv == NULL) 476 { 477 OutputDebugStringA("Failed to retrieve 'alGetEffectiv' function address\n"); 478 } 479 lpOALFnTable->alGetEffectf = (LPALGETEFFECTF)GetProcAddress(g_hOpenALDLL, "alGetEffectf"); 480 if (lpOALFnTable->alGetEffectf == NULL) 481 { 482 OutputDebugStringA("Failed to retrieve 'alGetEffectf' function address\n"); 483 } 484 lpOALFnTable->alGetEffectfv = (LPALGETEFFECTFV)GetProcAddress(g_hOpenALDLL, "alGetEffectfv"); 485 if (lpOALFnTable->alGetEffectfv == NULL) 486 { 487 OutputDebugStringA("Failed to retrieve 'alGetEffectfv' function address\n"); 488 } 489 490 lpOALFnTable->alDeleteEffects = (LPALDELETEEFFECTS)GetProcAddress(g_hOpenALDLL, "alDeleteEffects"); 491 if (lpOALFnTable->alDeleteEffects == NULL) 492 { 493 OutputDebugStringA("Failed to retrieve 'alDeleteEffects' function address\n"); 494 } 495 lpOALFnTable->alIsEffect = (LPALISEFFECT)GetProcAddress(g_hOpenALDLL, "alIsEffect"); 496 if (lpOALFnTable->alIsEffect == NULL) 497 { 498 OutputDebugStringA("Failed to retrieve 'alIsEffect' function address\n"); 499 } 500 lpOALFnTable->alAuxiliaryEffectSlotf = (LPALAUXILIARYEFFECTSLOTF)GetProcAddress(g_hOpenALDLL, "alAuxiliaryEffectSlotf"); 501 if (lpOALFnTable->alAuxiliaryEffectSlotf == NULL) 502 { 503 OutputDebugStringA("Failed to retrieve 'alAuxiliaryEffectSlotf' function address\n"); 504 } 505 lpOALFnTable->alAuxiliaryEffectSlotfv = (LPALAUXILIARYEFFECTSLOTFV)GetProcAddress(g_hOpenALDLL, "alAuxiliaryEffectSlotfv"); 506 if (lpOALFnTable->alAuxiliaryEffectSlotfv == NULL) 507 { 508 OutputDebugStringA("Failed to retrieve 'alAuxiliaryEffectSlotfv' function address\n"); 509 } 510 lpOALFnTable->alAuxiliaryEffectSloti = (LPALAUXILIARYEFFECTSLOTI)GetProcAddress(g_hOpenALDLL, "alAuxiliaryEffectSloti"); 511 if (lpOALFnTable->alAuxiliaryEffectSloti == NULL) 512 { 513 OutputDebugStringA("Failed to retrieve 'alAuxiliaryEffectSloti' function address\n"); 514 } 515 lpOALFnTable->alAuxiliaryEffectSlotiv = (LPALAUXILIARYEFFECTSLOTIV)GetProcAddress(g_hOpenALDLL, "alAuxiliaryEffectSlotiv"); 516 if (lpOALFnTable->alAuxiliaryEffectSlotiv == NULL) 517 { 518 OutputDebugStringA("Failed to retrieve 'alAuxiliaryEffectSlotiv' function address\n"); 519 } 520 lpOALFnTable->alIsAuxiliaryEffectSlot = (LPALISAUXILIARYEFFECTSLOT)GetProcAddress(g_hOpenALDLL, "alIsAuxiliaryEffectSlot"); 521 if (lpOALFnTable->alIsAuxiliaryEffectSlot == NULL) 522 { 523 OutputDebugStringA("Failed to retrieve 'alIsAuxiliaryEffectSlot' function address\n"); 524 } 525 lpOALFnTable->alGenAuxiliaryEffectSlots = (LPALGENAUXILIARYEFFECTSLOTS)GetProcAddress(g_hOpenALDLL, "alGenAuxiliaryEffectSlots"); 526 if (lpOALFnTable->alGenAuxiliaryEffectSlots == NULL) 527 { 528 OutputDebugStringA("Failed to retrieve 'alGenAuxiliaryEffectSlots' function address\n"); 529 } 530 lpOALFnTable->alDeleteAuxiliaryEffectSlots = (LPALDELETEAUXILIARYEFFECTSLOTS)GetProcAddress(g_hOpenALDLL, "alDeleteAuxiliaryEffectSlots"); 531 if (lpOALFnTable->alDeleteAuxiliaryEffectSlots == NULL) 532 { 533 OutputDebugStringA("Failed to retrieve 'alDeleteAuxiliaryEffectSlots' function address\n"); 534 } 535 lpOALFnTable->alGetAuxiliaryEffectSlotf = (LPALGETAUXILIARYEFFECTSLOTF)GetProcAddress(g_hOpenALDLL, "alGetAuxiliaryEffectSlotf"); 536 if (lpOALFnTable->alGetAuxiliaryEffectSlotf == NULL) 537 { 538 OutputDebugStringA("Failed to retrieve 'alGetAuxiliaryEffectSlotf' function address\n"); 539 } 540 lpOALFnTable->alGetAuxiliaryEffectSlotfv = (LPALGETAUXILIARYEFFECTSLOTFV)GetProcAddress(g_hOpenALDLL, "alGetAuxiliaryEffectSlotfv"); 541 if (lpOALFnTable->alGetAuxiliaryEffectSlotfv == NULL) 542 { 543 OutputDebugStringA("Failed to retrieve 'alGetAuxiliaryEffectSlotfv' function address\n"); 544 } 545 lpOALFnTable->alGetAuxiliaryEffectSloti = (LPALGETAUXILIARYEFFECTSLOTI)GetProcAddress(g_hOpenALDLL, "alGetAuxiliaryEffectSloti"); 546 if (lpOALFnTable->alGetAuxiliaryEffectSloti == NULL) 547 { 548 OutputDebugStringA("Failed to retrieve 'alGetAuxiliaryEffectSloti' function address\n"); 549 } 550 lpOALFnTable->alGetAuxiliaryEffectSlotiv = (LPALGETAUXILIARYEFFECTSLOTIV)GetProcAddress(g_hOpenALDLL, "alGetAuxiliaryEffectSlotiv"); 551 if (lpOALFnTable->alGetAuxiliaryEffectSlotiv == NULL) 552 { 553 OutputDebugStringA("Failed to retrieve 'alGetAuxiliaryEffectSlotiv' function address\n"); 554 } 555 lpOALFnTable->alSource3i = (LPALSOURCE3I)GetProcAddress(g_hOpenALDLL, "alSource3i"); 556#endif 557 return AL_TRUE; 558} 559 560ALvoid UnloadOAL10Library() 561{ 562 // Unload the dll 563 if (g_hOpenALDLL) 564 { 565 FreeLibrary(g_hOpenALDLL); 566 g_hOpenALDLL = NULL; 567 } 568} 569