LoadOAL.linux.cpp 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459
  1. //-----------------------------------------------------------------------------
  2. // Copyright (c) 2012 GarageGames, LLC
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files (the "Software"), to
  6. // deal in the Software without restriction, including without limitation the
  7. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  8. // sell copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  20. // IN THE SOFTWARE.
  21. //-----------------------------------------------------------------------------
  22. // TODO: Implement OpenAL loading code which is currently stubbed out.
  23. #if defined(__linux__) && !defined(TORQUE_OS_LINUX)
  24. #define TORQUE_OS_LINUX
  25. #endif
  26. #include <dlfcn.h>
  27. #include <err.h>
  28. #include <string.h>
  29. #include "sfx/openal/LoadOAL.h"
  30. #include "console/console.h"
  31. void* openal_library = NULL;
  32. ALboolean LoadOAL10Library(char *szOALFullPathName, LPOPENALFNTABLE lpOALFnTable)
  33. {
  34. if (!lpOALFnTable)
  35. return AL_FALSE;
  36. if (szOALFullPathName)
  37. openal_library = dlopen(szOALFullPathName, RTLD_LAZY);
  38. else
  39. openal_library = dlopen("libopenal.so", RTLD_LAZY);
  40. if (openal_library == NULL) {
  41. Con::errorf("Failed to load OpenAL shared library. Sound will not be available");
  42. return AL_FALSE;
  43. }
  44. memset(lpOALFnTable, 0, sizeof(OPENALFNTABLE));
  45. lpOALFnTable->alEnable = (LPALENABLE)dlsym(openal_library,"alEnable");
  46. if (lpOALFnTable->alEnable == NULL)
  47. {
  48. warn("Failed to retrieve 'alEnable' function address\n");
  49. return AL_FALSE;
  50. }
  51. lpOALFnTable->alDisable = (LPALDISABLE)dlsym(openal_library,"alDisable");
  52. if (lpOALFnTable->alDisable == NULL)
  53. {
  54. warn("Failed to retrieve 'alDisable' function address\n");
  55. return AL_FALSE;
  56. }
  57. lpOALFnTable->alIsEnabled = (LPALISENABLED)dlsym(openal_library,"alIsEnabled");
  58. if (lpOALFnTable->alIsEnabled == NULL)
  59. {
  60. warn("Failed to retrieve 'alIsEnabled' function address\n");
  61. return AL_FALSE;
  62. }
  63. lpOALFnTable->alGetBoolean = (LPALGETBOOLEAN)dlsym(openal_library,"alGetBoolean");
  64. if (lpOALFnTable->alGetBoolean == NULL)
  65. {
  66. warn("Failed to retrieve 'alGetBoolean' function address\n");
  67. return AL_FALSE;
  68. }
  69. lpOALFnTable->alGetInteger = (LPALGETINTEGER)dlsym(openal_library,"alGetInteger");
  70. if (lpOALFnTable->alGetInteger == NULL)
  71. {
  72. warn("Failed to retrieve 'alGetInteger' function address\n");
  73. return AL_FALSE;
  74. }
  75. lpOALFnTable->alGetFloat = (LPALGETFLOAT)dlsym(openal_library,"alGetFloat");
  76. if (lpOALFnTable->alGetFloat == NULL)
  77. {
  78. warn("Failed to retrieve 'alGetFloat' function address\n");
  79. return AL_FALSE;
  80. }
  81. lpOALFnTable->alGetDouble = (LPALGETDOUBLE)dlsym(openal_library,"alGetDouble");
  82. if (lpOALFnTable->alGetDouble == NULL)
  83. {
  84. warn("Failed to retrieve 'alGetDouble' function address\n");
  85. return AL_FALSE;
  86. }
  87. lpOALFnTable->alGetBooleanv = (LPALGETBOOLEANV)dlsym(openal_library,"alGetBooleanv");
  88. if (lpOALFnTable->alGetBooleanv == NULL)
  89. {
  90. warn("Failed to retrieve 'alGetBooleanv' function address\n");
  91. return AL_FALSE;
  92. }
  93. lpOALFnTable->alGetIntegerv = (LPALGETINTEGERV)dlsym(openal_library,"alGetIntegerv");
  94. if (lpOALFnTable->alGetIntegerv == NULL)
  95. {
  96. warn("Failed to retrieve 'alGetIntegerv' function address\n");
  97. return AL_FALSE;
  98. }
  99. lpOALFnTable->alGetFloatv = (LPALGETFLOATV)dlsym(openal_library,"alGetFloatv");
  100. if (lpOALFnTable->alGetFloatv == NULL)
  101. {
  102. warn("Failed to retrieve 'alGetFloatv' function address\n");
  103. return AL_FALSE;
  104. }
  105. lpOALFnTable->alGetDoublev = (LPALGETDOUBLEV)dlsym(openal_library,"alGetDoublev");
  106. if (lpOALFnTable->alGetDoublev == NULL)
  107. {
  108. warn("Failed to retrieve 'alGetDoublev' function address\n");
  109. return AL_FALSE;
  110. }
  111. lpOALFnTable->alGetString = (LPALGETSTRING)dlsym(openal_library,"alGetString");
  112. if (lpOALFnTable->alGetString == NULL)
  113. {
  114. warn("Failed to retrieve 'alGetString' function address\n");
  115. return AL_FALSE;
  116. }
  117. lpOALFnTable->alGetError = (LPALGETERROR)dlsym(openal_library,"alGetError");
  118. if (lpOALFnTable->alGetError == NULL)
  119. {
  120. warn("Failed to retrieve 'alGetError' function address\n");
  121. return AL_FALSE;
  122. }
  123. lpOALFnTable->alIsExtensionPresent = (LPALISEXTENSIONPRESENT)dlsym(openal_library,"alIsExtensionPresent");
  124. if (lpOALFnTable->alIsExtensionPresent == NULL)
  125. {
  126. warn("Failed to retrieve 'alIsExtensionPresent' function address\n");
  127. return AL_FALSE;
  128. }
  129. lpOALFnTable->alGetProcAddress = (LPALGETPROCADDRESS)dlsym(openal_library,"alGetProcAddress");
  130. if (lpOALFnTable->alGetProcAddress == NULL)
  131. {
  132. warn("Failed to retrieve 'alGetProcAddress' function address\n");
  133. return AL_FALSE;
  134. }
  135. lpOALFnTable->alGetEnumValue = (LPALGETENUMVALUE)dlsym(openal_library,"alGetEnumValue");
  136. if (lpOALFnTable->alGetEnumValue == NULL)
  137. {
  138. warn("Failed to retrieve 'alGetEnumValue' function address\n");
  139. return AL_FALSE;
  140. }
  141. lpOALFnTable->alListeneri = (LPALLISTENERI)dlsym(openal_library,"alListeneri");
  142. if (lpOALFnTable->alListeneri == NULL)
  143. {
  144. warn("Failed to retrieve 'alListeneri' function address\n");
  145. return AL_FALSE;
  146. }
  147. lpOALFnTable->alListenerf = (LPALLISTENERF)dlsym(openal_library,"alListenerf");
  148. if (lpOALFnTable->alListenerf == NULL)
  149. {
  150. warn("Failed to retrieve 'alListenerf' function address\n");
  151. return AL_FALSE;
  152. }
  153. lpOALFnTable->alListener3f = (LPALLISTENER3F)dlsym(openal_library,"alListener3f");
  154. if (lpOALFnTable->alListener3f == NULL)
  155. {
  156. warn("Failed to retrieve 'alListener3f' function address\n");
  157. return AL_FALSE;
  158. }
  159. lpOALFnTable->alListenerfv = (LPALLISTENERFV)dlsym(openal_library,"alListenerfv");
  160. if (lpOALFnTable->alListenerfv == NULL)
  161. {
  162. warn("Failed to retrieve 'alListenerfv' function address\n");
  163. return AL_FALSE;
  164. }
  165. lpOALFnTable->alGetListeneri = (LPALGETLISTENERI)dlsym(openal_library,"alGetListeneri");
  166. if (lpOALFnTable->alGetListeneri == NULL)
  167. {
  168. warn("Failed to retrieve 'alGetListeneri' function address\n");
  169. return AL_FALSE;
  170. }
  171. lpOALFnTable->alGetListenerf =(LPALGETLISTENERF)dlsym(openal_library,"alGetListenerf");
  172. if (lpOALFnTable->alGetListenerf == NULL)
  173. {
  174. warn("Failed to retrieve 'alGetListenerf' function address\n");
  175. return AL_FALSE;
  176. }
  177. lpOALFnTable->alGetListener3f = (LPALGETLISTENER3F)dlsym(openal_library,"alGetListener3f");
  178. if (lpOALFnTable->alGetListener3f == NULL)
  179. {
  180. warn("Failed to retrieve 'alGetListener3f' function address\n");
  181. return AL_FALSE;
  182. }
  183. lpOALFnTable->alGetListenerfv = (LPALGETLISTENERFV)dlsym(openal_library,"alGetListenerfv");
  184. if (lpOALFnTable->alGetListenerfv == NULL)
  185. {
  186. warn("Failed to retrieve 'alGetListenerfv' function address\n");
  187. return AL_FALSE;
  188. }
  189. lpOALFnTable->alGenSources = (LPALGENSOURCES)dlsym(openal_library,"alGenSources");
  190. if (lpOALFnTable->alGenSources == NULL)
  191. {
  192. warn("Failed to retrieve 'alGenSources' function address\n");
  193. return AL_FALSE;
  194. }
  195. lpOALFnTable->alDeleteSources = (LPALDELETESOURCES)dlsym(openal_library,"alDeleteSources");
  196. if (lpOALFnTable->alDeleteSources == NULL)
  197. {
  198. warn("Failed to retrieve 'alDeleteSources' function address\n");
  199. return AL_FALSE;
  200. }
  201. lpOALFnTable->alIsSource = (LPALISSOURCE)dlsym(openal_library,"alIsSource");
  202. if (lpOALFnTable->alIsSource == NULL)
  203. {
  204. warn("Failed to retrieve 'alIsSource' function address\n");
  205. return AL_FALSE;
  206. }
  207. lpOALFnTable->alSourcei = (LPALSOURCEI)dlsym(openal_library,"alSourcei");
  208. if (lpOALFnTable->alSourcei == NULL)
  209. {
  210. warn("Failed to retrieve 'alSourcei' function address\n");
  211. return AL_FALSE;
  212. }
  213. lpOALFnTable->alSourcef = (LPALSOURCEF)dlsym(openal_library,"alSourcef");
  214. if (lpOALFnTable->alSourcef == NULL)
  215. {
  216. warn("Failed to retrieve 'alSourcef' function address\n");
  217. return AL_FALSE;
  218. }
  219. lpOALFnTable->alSource3f = (LPALSOURCE3F)dlsym(openal_library,"alSource3f");
  220. if (lpOALFnTable->alSource3f == NULL)
  221. {
  222. warn("Failed to retrieve 'alSource3f' function address\n");
  223. return AL_FALSE;
  224. }
  225. lpOALFnTable->alSourcefv = (LPALSOURCEFV)dlsym(openal_library,"alSourcefv");
  226. if (lpOALFnTable->alSourcefv == NULL)
  227. {
  228. warn("Failed to retrieve 'alSourcefv' function address\n");
  229. return AL_FALSE;
  230. }
  231. lpOALFnTable->alGetSourcei = (LPALGETSOURCEI)dlsym(openal_library,"alGetSourcei");
  232. if (lpOALFnTable->alGetSourcei == NULL)
  233. {
  234. warn("Failed to retrieve 'alGetSourcei' function address\n");
  235. return AL_FALSE;
  236. }
  237. lpOALFnTable->alGetSourcef = (LPALGETSOURCEF)dlsym(openal_library,"alGetSourcef");
  238. if (lpOALFnTable->alGetSourcef == NULL)
  239. {
  240. warn("Failed to retrieve 'alGetSourcef' function address\n");
  241. return AL_FALSE;
  242. }
  243. lpOALFnTable->alGetSourcefv = (LPALGETSOURCEFV)dlsym(openal_library,"alGetSourcefv");
  244. if (lpOALFnTable->alGetSourcefv == NULL)
  245. {
  246. warn("Failed to retrieve 'alGetSourcefv' function address\n");
  247. return AL_FALSE;
  248. }
  249. lpOALFnTable->alSourcePlayv = (LPALSOURCEPLAYV)dlsym(openal_library,"alSourcePlayv");
  250. if (lpOALFnTable->alSourcePlayv == NULL)
  251. {
  252. warn("Failed to retrieve 'alSourcePlayv' function address\n");
  253. return AL_FALSE;
  254. }
  255. lpOALFnTable->alSourceStopv = (LPALSOURCESTOPV)dlsym(openal_library,"alSourceStopv");
  256. if (lpOALFnTable->alSourceStopv == NULL)
  257. {
  258. warn("Failed to retrieve 'alSourceStopv' function address\n");
  259. return AL_FALSE;
  260. }
  261. lpOALFnTable->alSourcePlay = (LPALSOURCEPLAY)dlsym(openal_library,"alSourcePlay");
  262. if (lpOALFnTable->alSourcePlay == NULL)
  263. {
  264. warn("Failed to retrieve 'alSourcePlay' function address\n");
  265. return AL_FALSE;
  266. }
  267. lpOALFnTable->alSourcePause = (LPALSOURCEPAUSE)dlsym(openal_library,"alSourcePause");
  268. if (lpOALFnTable->alSourcePause == NULL)
  269. {
  270. warn("Failed to retrieve 'alSourcePause' function address\n");
  271. return AL_FALSE;
  272. }
  273. lpOALFnTable->alSourceStop = (LPALSOURCESTOP)dlsym(openal_library,"alSourceStop");
  274. if (lpOALFnTable->alSourceStop == NULL)
  275. {
  276. warn("Failed to retrieve 'alSourceStop' function address\n");
  277. return AL_FALSE;
  278. }
  279. lpOALFnTable->alSourceRewind = (LPALSOURCEREWIND)dlsym(openal_library,"alSourceRewind");
  280. if (lpOALFnTable->alSourceRewind == NULL)
  281. {
  282. warn("Failed to retrieve 'alSourceRewind' function address\n");
  283. return AL_FALSE;
  284. }
  285. lpOALFnTable->alGenBuffers = (LPALGENBUFFERS)dlsym(openal_library,"alGenBuffers");
  286. if (lpOALFnTable->alGenBuffers == NULL)
  287. {
  288. warn("Failed to retrieve 'alGenBuffers' function address\n");
  289. return AL_FALSE;
  290. }
  291. lpOALFnTable->alDeleteBuffers = (LPALDELETEBUFFERS)dlsym(openal_library,"alDeleteBuffers");
  292. if (lpOALFnTable->alDeleteBuffers == NULL)
  293. {
  294. warn("Failed to retrieve 'alDeleteBuffers' function address\n");
  295. return AL_FALSE;
  296. }
  297. lpOALFnTable->alIsBuffer = (LPALISBUFFER)dlsym(openal_library,"alIsBuffer");
  298. if (lpOALFnTable->alIsBuffer == NULL)
  299. {
  300. warn("Failed to retrieve 'alIsBuffer' function address\n");
  301. return AL_FALSE;
  302. }
  303. lpOALFnTable->alBufferData = (LPALBUFFERDATA)dlsym(openal_library,"alBufferData");
  304. if (lpOALFnTable->alBufferData == NULL)
  305. {
  306. warn("Failed to retrieve 'alBufferData' function address\n");
  307. return AL_FALSE;
  308. }
  309. lpOALFnTable->alGetBufferi = (LPALGETBUFFERI)dlsym(openal_library,"alGetBufferi");
  310. if (lpOALFnTable->alGetBufferi == NULL)
  311. {
  312. warn("Failed to retrieve 'alGetBufferi' function address\n");
  313. return AL_FALSE;
  314. }
  315. lpOALFnTable->alGetBufferf = (LPALGETBUFFERF)dlsym(openal_library,"alGetBufferf");
  316. if (lpOALFnTable->alGetBufferf == NULL)
  317. {
  318. warn("Failed to retrieve 'alGetBufferf' function address\n");
  319. return AL_FALSE;
  320. }
  321. lpOALFnTable->alSourceQueueBuffers = (LPALSOURCEQUEUEBUFFERS)dlsym(openal_library,"alSourceQueueBuffers");
  322. if (lpOALFnTable->alSourceQueueBuffers == NULL)
  323. {
  324. warn("Failed to retrieve 'alSourceQueueBuffers' function address\n");
  325. return AL_FALSE;
  326. }
  327. lpOALFnTable->alSourceUnqueueBuffers = (LPALSOURCEUNQUEUEBUFFERS)dlsym(openal_library,"alSourceUnqueueBuffers");
  328. if (lpOALFnTable->alSourceUnqueueBuffers == NULL)
  329. {
  330. warn("Failed to retrieve 'alSourceUnqueueBuffers' function address\n");
  331. return AL_FALSE;
  332. }
  333. lpOALFnTable->alDistanceModel = (LPALDISTANCEMODEL)dlsym(openal_library,"alDistanceModel");
  334. if (lpOALFnTable->alDistanceModel == NULL)
  335. {
  336. warn("Failed to retrieve 'alDistanceModel' function address\n");
  337. return AL_FALSE;
  338. }
  339. lpOALFnTable->alDopplerFactor = (LPALDOPPLERFACTOR)dlsym(openal_library,"alDopplerFactor");
  340. if (lpOALFnTable->alDopplerFactor == NULL)
  341. {
  342. warn("Failed to retrieve 'alDopplerFactor' function address\n");
  343. return AL_FALSE;
  344. }
  345. lpOALFnTable->alDopplerVelocity = (LPALDOPPLERVELOCITY)dlsym(openal_library,"alDopplerVelocity");
  346. if (lpOALFnTable->alDopplerVelocity == NULL)
  347. {
  348. warn("Failed to retrieve 'alDopplerVelocity' function address\n");
  349. return AL_FALSE;
  350. }
  351. lpOALFnTable->alcGetString = (LPALCGETSTRING)dlsym(openal_library,"alcGetString");
  352. if (lpOALFnTable->alcGetString == NULL)
  353. {
  354. warn("Failed to retrieve 'alcGetString' function address\n");
  355. return AL_FALSE;
  356. }
  357. lpOALFnTable->alcGetIntegerv = (LPALCGETINTEGERV)dlsym(openal_library,"alcGetIntegerv");
  358. if (lpOALFnTable->alcGetIntegerv == NULL)
  359. {
  360. warn("Failed to retrieve 'alcGetIntegerv' function address\n");
  361. return AL_FALSE;
  362. }
  363. lpOALFnTable->alcOpenDevice = (LPALCOPENDEVICE)dlsym(openal_library,"alcOpenDevice");
  364. if (lpOALFnTable->alcOpenDevice == NULL)
  365. {
  366. warn("Failed to retrieve 'alcOpenDevice' function address\n");
  367. return AL_FALSE;
  368. }
  369. lpOALFnTable->alcCloseDevice = (LPALCCLOSEDEVICE)dlsym(openal_library,"alcCloseDevice");
  370. if (lpOALFnTable->alcCloseDevice == NULL)
  371. {
  372. warn("Failed to retrieve 'alcCloseDevice' function address\n");
  373. return AL_FALSE;
  374. }
  375. lpOALFnTable->alcCreateContext = (LPALCCREATECONTEXT)dlsym(openal_library,"alcCreateContext");
  376. if (lpOALFnTable->alcCreateContext == NULL)
  377. {
  378. warn("Failed to retrieve 'alcCreateContext' function address\n");
  379. return AL_FALSE;
  380. }
  381. lpOALFnTable->alcMakeContextCurrent = (LPALCMAKECONTEXTCURRENT)dlsym(openal_library,"alcMakeContextCurrent");
  382. if (lpOALFnTable->alcMakeContextCurrent == NULL)
  383. {
  384. warn("Failed to retrieve 'alcMakeContextCurrent' function address\n");
  385. return AL_FALSE;
  386. }
  387. lpOALFnTable->alcProcessContext = (LPALCPROCESSCONTEXT)dlsym(openal_library,"alcProcessContext");
  388. if (lpOALFnTable->alcProcessContext == NULL)
  389. {
  390. warn("Failed to retrieve 'alcProcessContext' function address\n");
  391. return AL_FALSE;
  392. }
  393. lpOALFnTable->alcGetCurrentContext = (LPALCGETCURRENTCONTEXT)dlsym(openal_library,"alcGetCurrentContext");
  394. if (lpOALFnTable->alcGetCurrentContext == NULL)
  395. {
  396. warn("Failed to retrieve 'alcGetCurrentContext' function address\n");
  397. return AL_FALSE;
  398. }
  399. lpOALFnTable->alcGetContextsDevice = (LPALCGETCONTEXTSDEVICE)dlsym(openal_library,"alcGetContextsDevice");
  400. if (lpOALFnTable->alcGetContextsDevice == NULL)
  401. {
  402. warn("Failed to retrieve 'alcGetContextsDevice' function address\n");
  403. return AL_FALSE;
  404. }
  405. lpOALFnTable->alcSuspendContext = (LPALCSUSPENDCONTEXT)dlsym(openal_library,"alcSuspendContext");
  406. if (lpOALFnTable->alcSuspendContext == NULL)
  407. {
  408. warn("Failed to retrieve 'alcSuspendContext' function address\n");
  409. return AL_FALSE;
  410. }
  411. lpOALFnTable->alcDestroyContext = (LPALCDESTROYCONTEXT)dlsym(openal_library,"alcDestroyContext");
  412. if (lpOALFnTable->alcDestroyContext == NULL)
  413. {
  414. warn("Failed to retrieve 'alcDestroyContext' function address\n");
  415. return AL_FALSE;
  416. }
  417. lpOALFnTable->alcGetError = (LPALCGETERROR)dlsym(openal_library,"alcGetError");
  418. if (lpOALFnTable->alcGetError == NULL)
  419. {
  420. warn("Failed to retrieve 'alcGetError' function address\n");
  421. return AL_FALSE;
  422. }
  423. lpOALFnTable->alcIsExtensionPresent = (LPALCISEXTENSIONPRESENT)dlsym(openal_library,"alcIsExtensionPresent");
  424. if (lpOALFnTable->alcIsExtensionPresent == NULL)
  425. {
  426. warn("Failed to retrieve 'alcIsExtensionPresent' function address\n");
  427. return AL_FALSE;
  428. }
  429. lpOALFnTable->alcGetProcAddress = (LPALCGETPROCADDRESS)dlsym(openal_library,"alcGetProcAddress");
  430. if (lpOALFnTable->alcGetProcAddress == NULL)
  431. {
  432. warn("Failed to retrieve 'alcGetProcAddress' function address\n");
  433. return AL_FALSE;
  434. }
  435. lpOALFnTable->alcGetEnumValue = (LPALCGETENUMVALUE)dlsym(openal_library,"alcGetEnumValue");
  436. if (lpOALFnTable->alcGetEnumValue == NULL)
  437. {
  438. warn("Failed to retrieve 'alcGetEnumValue' function address\n");
  439. return AL_FALSE;
  440. }
  441. return AL_TRUE;
  442. }
  443. ALvoid UnloadOAL10Library()
  444. {
  445. if (openal_library != NULL)
  446. dlclose(openal_library);
  447. }