1 // NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #include "stdopenal.h"
25 nldebug("AL: Initializing extensions");
27 if ((AlEnumerationExt
= (alcIsExtensionPresent(NULL
, "ALC_ENUMERATION_EXT") == AL_TRUE
)) == true)
32 if ((AlEnumerateAllExt
= (alcIsExtensionPresent(NULL
, "ALC_ENUMERATE_ALL_EXT") == AL_TRUE
)) == true)
38 void alExtInitDevice(ALCdevice
*device
)
40 nldebug("AL: Initializing device extensions");
44 if (AlExtEax
= (alIsExtensionPresent("EAX") == AL_TRUE
))
46 eaxSet
= (EAXSet
)alGetProcAddress("EAXSet");
47 eaxGet
= (EAXGet
)alGetProcAddress("EAXGet");
48 if (!eaxSet
|| !eaxGet
)
50 nlwarning("AL: EAX alGetProcAddress failed");
57 if ((AlExtXRam
= ((alIsExtensionPresent("EAX-RAM") == AL_TRUE
)
58 || (alIsExtensionPresent("EAX_RAM") == AL_TRUE
))) == true)
60 eaxSetBufferMode
= (EAXSetBufferMode
)alGetProcAddress("EAXSetBufferMode");
61 eaxGetBufferMode
= (EAXGetBufferMode
)alGetProcAddress("EAXGetBufferMode");
62 if (!eaxSetBufferMode
|| !eaxGetBufferMode
)
64 nlwarning("AL: EAX-RAM alGetProcAddress failed");
69 #if !defined(AL_LIBTYPE_STATIC)
70 // Windows and Mac OS always link to shared OpenAL library
71 #if defined(NL_OS_WINDOWS) || defined(NL_OS_MAC) || !defined(NL_STATIC)
73 if ((AlExtEfx
= (alcIsExtensionPresent(device
, "ALC_EXT_EFX") == ALC_TRUE
)) == true)
76 alGenEffects
= (LPALGENEFXOBJECTS
)alGetProcAddress("alGenEffects");
77 alDeleteEffects
= (LPALDELETEEFXOBJECTS
)alGetProcAddress("alDeleteEffects");
78 alIsEffect
= (LPALISEFXOBJECT
)alGetProcAddress("alIsEffect");
79 alEffecti
= (LPALEFXOBJECTI
)alGetProcAddress("alEffecti");
80 alEffectiv
= (LPALEFXOBJECTIV
)alGetProcAddress("alEffectiv");
81 alEffectf
= (LPALEFXOBJECTF
)alGetProcAddress("alEffectf");
82 alEffectfv
= (LPALEFXOBJECTFV
)alGetProcAddress("alEffectfv");
83 alGetEffecti
= (LPALGETEFXOBJECTI
)alGetProcAddress("alGetEffecti");
84 alGetEffectiv
= (LPALGETEFXOBJECTIV
)alGetProcAddress("alGetEffectiv");
85 alGetEffectf
= (LPALGETEFXOBJECTF
)alGetProcAddress("alGetEffectf");
86 alGetEffectfv
= (LPALGETEFXOBJECTFV
)alGetProcAddress("alGetEffectfv");
88 alGenFilters
= (LPALGENEFXOBJECTS
)alGetProcAddress("alGenFilters");
89 alDeleteFilters
= (LPALDELETEEFXOBJECTS
)alGetProcAddress("alDeleteFilters");
90 alIsFilter
= (LPALISEFXOBJECT
)alGetProcAddress("alIsFilter");
91 alFilteri
= (LPALEFXOBJECTI
)alGetProcAddress("alFilteri");
92 alFilteriv
= (LPALEFXOBJECTIV
)alGetProcAddress("alFilteriv");
93 alFilterf
= (LPALEFXOBJECTF
)alGetProcAddress("alFilterf");
94 alFilterfv
= (LPALEFXOBJECTFV
)alGetProcAddress("alFilterfv");
95 alGetFilteri
= (LPALGETEFXOBJECTI
)alGetProcAddress("alGetFilteri");
96 alGetFilteriv
= (LPALGETEFXOBJECTIV
)alGetProcAddress("alGetFilteriv");
97 alGetFilterf
= (LPALGETEFXOBJECTF
)alGetProcAddress("alGetFilterf");
98 alGetFilterfv
= (LPALGETEFXOBJECTFV
)alGetProcAddress("alGetFilterfv");
100 alGenAuxiliaryEffectSlots
= (LPALGENEFXOBJECTS
)alGetProcAddress("alGenAuxiliaryEffectSlots");
101 alDeleteAuxiliaryEffectSlots
= (LPALDELETEEFXOBJECTS
)alGetProcAddress("alDeleteAuxiliaryEffectSlots");
102 alIsAuxiliaryEffectSlot
= (LPALISEFXOBJECT
)alGetProcAddress("alIsAuxiliaryEffectSlot");
103 alAuxiliaryEffectSloti
= (LPALEFXOBJECTI
)alGetProcAddress("alAuxiliaryEffectSloti");
104 alAuxiliaryEffectSlotiv
= (LPALEFXOBJECTIV
)alGetProcAddress("alAuxiliaryEffectSlotiv");
105 alAuxiliaryEffectSlotf
= (LPALEFXOBJECTF
)alGetProcAddress("alAuxiliaryEffectSlotf");
106 alAuxiliaryEffectSlotfv
= (LPALEFXOBJECTFV
)alGetProcAddress("alAuxiliaryEffectSlotfv");
107 alGetAuxiliaryEffectSloti
= (LPALGETEFXOBJECTI
)alGetProcAddress("alGetAuxiliaryEffectSloti");
108 alGetAuxiliaryEffectSlotiv
= (LPALGETEFXOBJECTIV
)alGetProcAddress("alGetAuxiliaryEffectSlotiv");
109 alGetAuxiliaryEffectSlotf
= (LPALGETEFXOBJECTF
)alGetProcAddress("alGetAuxiliaryEffectSlotf");
110 alGetAuxiliaryEffectSlotfv
= (LPALGETEFXOBJECTFV
)alGetProcAddress("alGetFilterfv");
111 if (!alGenEffects
|| !alGenFilters
|| !alGenAuxiliaryEffectSlots
)
113 nlwarning("AL: ALC_EXT_EFX alcGetProcAddress failed");
123 bool AlExtEax
= false;
124 EAXSet eaxSet
= NULL
;
125 EAXGet eaxGet
= NULL
;
128 // ALC_ENUMERATION_EXT
129 bool AlEnumerationExt
= false;
131 // ALC_ENUMERATE_ALL_EXT
132 bool AlEnumerateAllExt
= false;
135 bool AlExtXRam
= false;
136 EAXSetBufferMode eaxSetBufferMode
= NULL
;
137 EAXGetBufferMode eaxGetBufferMode
= NULL
;
140 bool AlExtEfx
= false;
142 #if !defined(AL_LIBTYPE_STATIC)
143 #if defined(NL_OS_WINDOWS) || defined(NL_OS_MAC) || !defined(NL_STATIC)
144 LPALGENEFXOBJECTS alGenEffects
= NULL
;
145 LPALDELETEEFXOBJECTS alDeleteEffects
= NULL
;
146 LPALISEFXOBJECT alIsEffect
= NULL
;
147 LPALEFXOBJECTI alEffecti
= NULL
;
148 LPALEFXOBJECTIV alEffectiv
= NULL
;
149 LPALEFXOBJECTF alEffectf
= NULL
;
150 LPALEFXOBJECTFV alEffectfv
= NULL
;
151 LPALGETEFXOBJECTI alGetEffecti
= NULL
;
152 LPALGETEFXOBJECTIV alGetEffectiv
= NULL
;
153 LPALGETEFXOBJECTF alGetEffectf
= NULL
;
154 LPALGETEFXOBJECTFV alGetEffectfv
= NULL
;
156 LPALGENEFXOBJECTS alGenFilters
= NULL
;
157 LPALDELETEEFXOBJECTS alDeleteFilters
= NULL
;
158 LPALISEFXOBJECT alIsFilter
= NULL
;
159 LPALEFXOBJECTI alFilteri
= NULL
;
160 LPALEFXOBJECTIV alFilteriv
= NULL
;
161 LPALEFXOBJECTF alFilterf
= NULL
;
162 LPALEFXOBJECTFV alFilterfv
= NULL
;
163 LPALGETEFXOBJECTI alGetFilteri
= NULL
;
164 LPALGETEFXOBJECTIV alGetFilteriv
= NULL
;
165 LPALGETEFXOBJECTF alGetFilterf
= NULL
;
166 LPALGETEFXOBJECTFV alGetFilterfv
= NULL
;
168 LPALGENEFXOBJECTS alGenAuxiliaryEffectSlots
= NULL
;
169 LPALDELETEEFXOBJECTS alDeleteAuxiliaryEffectSlots
= NULL
;
170 LPALISEFXOBJECT alIsAuxiliaryEffectSlot
= NULL
;
171 LPALEFXOBJECTI alAuxiliaryEffectSloti
= NULL
;
172 LPALEFXOBJECTIV alAuxiliaryEffectSlotiv
= NULL
;
173 LPALEFXOBJECTF alAuxiliaryEffectSlotf
= NULL
;
174 LPALEFXOBJECTFV alAuxiliaryEffectSlotfv
= NULL
;
175 LPALGETEFXOBJECTI alGetAuxiliaryEffectSloti
= NULL
;
176 LPALGETEFXOBJECTIV alGetAuxiliaryEffectSlotiv
= NULL
;
177 LPALGETEFXOBJECTF alGetAuxiliaryEffectSlotf
= NULL
;
178 LPALGETEFXOBJECTFV alGetAuxiliaryEffectSlotfv
= NULL
;