Linux multi-monitor fullscreen support
[ryzomcore.git] / nel / src / sound / driver / openal / ext_al.cpp
blobe6a090e80ec485a76753dff7f1cf887c6a8353fb
1 // NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
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.
8 //
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"
18 #include "ext_al.h"
20 extern "C"
23 void alExtInit()
25 nldebug("AL: Initializing extensions");
27 if ((AlEnumerationExt = (alcIsExtensionPresent(NULL, "ALC_ENUMERATION_EXT") == AL_TRUE)) == true)
29 // ...
32 if ((AlEnumerateAllExt = (alcIsExtensionPresent(NULL, "ALC_ENUMERATE_ALL_EXT") == AL_TRUE)) == true)
34 // ...
38 void alExtInitDevice(ALCdevice *device)
40 nldebug("AL: Initializing device extensions");
42 #if EAX_AVAILABLE
43 // EAX
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");
51 AlExtEax = false;
54 #endif
56 // EAX-RAM
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");
65 AlExtXRam = false;
69 // Windows and Mac OS always link to shared OpenAL library
70 #if defined(NL_OS_WINDOWS) || defined(NL_OS_MAC) || !defined(NL_STATIC)
71 // EFX
72 if ((AlExtEfx = (alcIsExtensionPresent(device, "ALC_EXT_EFX") == ALC_TRUE)) == true)
74 // effect objects
75 alGenEffects = (LPALGENEFXOBJECTS)alGetProcAddress("alGenEffects");
76 alDeleteEffects = (LPALDELETEEFXOBJECTS)alGetProcAddress("alDeleteEffects");
77 alIsEffect = (LPALISEFXOBJECT)alGetProcAddress("alIsEffect");
78 alEffecti = (LPALEFXOBJECTI)alGetProcAddress("alEffecti");
79 alEffectiv = (LPALEFXOBJECTIV)alGetProcAddress("alEffectiv");
80 alEffectf = (LPALEFXOBJECTF)alGetProcAddress("alEffectf");
81 alEffectfv = (LPALEFXOBJECTFV)alGetProcAddress("alEffectfv");
82 alGetEffecti = (LPALGETEFXOBJECTI)alGetProcAddress("alGetEffecti");
83 alGetEffectiv = (LPALGETEFXOBJECTIV)alGetProcAddress("alGetEffectiv");
84 alGetEffectf = (LPALGETEFXOBJECTF)alGetProcAddress("alGetEffectf");
85 alGetEffectfv = (LPALGETEFXOBJECTFV)alGetProcAddress("alGetEffectfv");
86 // effect objects
87 alGenFilters = (LPALGENEFXOBJECTS)alGetProcAddress("alGenFilters");
88 alDeleteFilters = (LPALDELETEEFXOBJECTS)alGetProcAddress("alDeleteFilters");
89 alIsFilter = (LPALISEFXOBJECT)alGetProcAddress("alIsFilter");
90 alFilteri = (LPALEFXOBJECTI)alGetProcAddress("alFilteri");
91 alFilteriv = (LPALEFXOBJECTIV)alGetProcAddress("alFilteriv");
92 alFilterf = (LPALEFXOBJECTF)alGetProcAddress("alFilterf");
93 alFilterfv = (LPALEFXOBJECTFV)alGetProcAddress("alFilterfv");
94 alGetFilteri = (LPALGETEFXOBJECTI)alGetProcAddress("alGetFilteri");
95 alGetFilteriv = (LPALGETEFXOBJECTIV)alGetProcAddress("alGetFilteriv");
96 alGetFilterf = (LPALGETEFXOBJECTF)alGetProcAddress("alGetFilterf");
97 alGetFilterfv = (LPALGETEFXOBJECTFV)alGetProcAddress("alGetFilterfv");
98 // submix objects
99 alGenAuxiliaryEffectSlots = (LPALGENEFXOBJECTS)alGetProcAddress("alGenAuxiliaryEffectSlots");
100 alDeleteAuxiliaryEffectSlots = (LPALDELETEEFXOBJECTS)alGetProcAddress("alDeleteAuxiliaryEffectSlots");
101 alIsAuxiliaryEffectSlot = (LPALISEFXOBJECT)alGetProcAddress("alIsAuxiliaryEffectSlot");
102 alAuxiliaryEffectSloti = (LPALEFXOBJECTI)alGetProcAddress("alAuxiliaryEffectSloti");
103 alAuxiliaryEffectSlotiv = (LPALEFXOBJECTIV)alGetProcAddress("alAuxiliaryEffectSlotiv");
104 alAuxiliaryEffectSlotf = (LPALEFXOBJECTF)alGetProcAddress("alAuxiliaryEffectSlotf");
105 alAuxiliaryEffectSlotfv = (LPALEFXOBJECTFV)alGetProcAddress("alAuxiliaryEffectSlotfv");
106 alGetAuxiliaryEffectSloti = (LPALGETEFXOBJECTI)alGetProcAddress("alGetAuxiliaryEffectSloti");
107 alGetAuxiliaryEffectSlotiv = (LPALGETEFXOBJECTIV)alGetProcAddress("alGetAuxiliaryEffectSlotiv");
108 alGetAuxiliaryEffectSlotf = (LPALGETEFXOBJECTF)alGetProcAddress("alGetAuxiliaryEffectSlotf");
109 alGetAuxiliaryEffectSlotfv = (LPALGETEFXOBJECTFV)alGetProcAddress("alGetFilterfv");
110 if (!alGenEffects || !alGenFilters || !alGenAuxiliaryEffectSlots)
112 nlwarning("AL: ALC_EXT_EFX alcGetProcAddress failed");
113 AlExtEfx = false;
116 #endif
119 #if EAX_AVAILABLE
120 // EAX
121 bool AlExtEax = false;
122 EAXSet eaxSet = NULL;
123 EAXGet eaxGet = NULL;
124 #endif
126 // ALC_ENUMERATION_EXT
127 bool AlEnumerationExt = false;
129 // ALC_ENUMERATE_ALL_EXT
130 bool AlEnumerateAllExt = false;
132 // EAX-RAM
133 bool AlExtXRam = false;
134 EAXSetBufferMode eaxSetBufferMode = NULL;
135 EAXGetBufferMode eaxGetBufferMode = NULL;
137 // ALC_EXT_EFX
138 bool AlExtEfx = false;
139 // effect objects
140 #if defined(NL_OS_WINDOWS) || defined(NL_OS_MAC) || !defined(NL_STATIC)
141 LPALGENEFXOBJECTS alGenEffects = NULL;
142 LPALDELETEEFXOBJECTS alDeleteEffects = NULL;
143 LPALISEFXOBJECT alIsEffect = NULL;
144 LPALEFXOBJECTI alEffecti = NULL;
145 LPALEFXOBJECTIV alEffectiv = NULL;
146 LPALEFXOBJECTF alEffectf = NULL;
147 LPALEFXOBJECTFV alEffectfv = NULL;
148 LPALGETEFXOBJECTI alGetEffecti = NULL;
149 LPALGETEFXOBJECTIV alGetEffectiv = NULL;
150 LPALGETEFXOBJECTF alGetEffectf = NULL;
151 LPALGETEFXOBJECTFV alGetEffectfv = NULL;
152 // filter objects
153 LPALGENEFXOBJECTS alGenFilters = NULL;
154 LPALDELETEEFXOBJECTS alDeleteFilters = NULL;
155 LPALISEFXOBJECT alIsFilter = NULL;
156 LPALEFXOBJECTI alFilteri = NULL;
157 LPALEFXOBJECTIV alFilteriv = NULL;
158 LPALEFXOBJECTF alFilterf = NULL;
159 LPALEFXOBJECTFV alFilterfv = NULL;
160 LPALGETEFXOBJECTI alGetFilteri = NULL;
161 LPALGETEFXOBJECTIV alGetFilteriv = NULL;
162 LPALGETEFXOBJECTF alGetFilterf = NULL;
163 LPALGETEFXOBJECTFV alGetFilterfv = NULL;
164 // submix objects
165 LPALGENEFXOBJECTS alGenAuxiliaryEffectSlots = NULL;
166 LPALDELETEEFXOBJECTS alDeleteAuxiliaryEffectSlots = NULL;
167 LPALISEFXOBJECT alIsAuxiliaryEffectSlot = NULL;
168 LPALEFXOBJECTI alAuxiliaryEffectSloti = NULL;
169 LPALEFXOBJECTIV alAuxiliaryEffectSlotiv = NULL;
170 LPALEFXOBJECTF alAuxiliaryEffectSlotf = NULL;
171 LPALEFXOBJECTFV alAuxiliaryEffectSlotfv = NULL;
172 LPALGETEFXOBJECTI alGetAuxiliaryEffectSloti = NULL;
173 LPALGETEFXOBJECTIV alGetAuxiliaryEffectSlotiv = NULL;
174 LPALGETEFXOBJECTF alGetAuxiliaryEffectSlotf = NULL;
175 LPALGETEFXOBJECTFV alGetAuxiliaryEffectSlotfv = NULL;
176 #endif
179 /* end of file */