Remove duplication of setting source angles
[openal-soft.git] / OpenAL32 / alExtension.c
blob3589ff63fc281ab0866bd38fa6ea55d3c8f585d1
1 /**
2 * OpenAL cross platform audio library
3 * Copyright (C) 1999-2007 by authors.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library 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 GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
18 * Or go to http://www.gnu.org/copyleft/lgpl.html
21 #include "config.h"
23 #include <stdlib.h>
24 #include <string.h>
25 #include <ctype.h>
26 #include "alExtension.h"
27 #include "alError.h"
28 #include "alMain.h"
29 #include "alFilter.h"
30 #include "alEffect.h"
31 #include "alAuxEffectSlot.h"
32 #include "alDatabuffer.h"
33 #include "alSource.h"
34 #include "alBuffer.h"
35 #include "AL/al.h"
36 #include "AL/alc.h"
38 static ALfunction function[]= {
39 { "alEnable", (ALvoid *) alEnable },
40 { "alDisable", (ALvoid *) alDisable },
41 { "alIsEnabled", (ALvoid *) alIsEnabled },
42 { "alGetString", (ALvoid *) alGetString },
43 { "alGetBooleanv", (ALvoid *) alGetBooleanv },
44 { "alGetIntegerv", (ALvoid *) alGetIntegerv },
45 { "alGetFloatv", (ALvoid *) alGetFloatv },
46 { "alGetDoublev", (ALvoid *) alGetDoublev },
47 { "alGetBoolean", (ALvoid *) alGetBoolean },
48 { "alGetInteger", (ALvoid *) alGetInteger },
49 { "alGetFloat", (ALvoid *) alGetFloat },
50 { "alGetDouble", (ALvoid *) alGetDouble },
51 { "alGetError", (ALvoid *) alGetError },
52 { "alIsExtensionPresent", (ALvoid *) alIsExtensionPresent },
53 { "alGetProcAddress", (ALvoid *) alGetProcAddress },
54 { "alGetEnumValue", (ALvoid *) alGetEnumValue },
55 { "alListenerf", (ALvoid *) alListenerf },
56 { "alListener3f", (ALvoid *) alListener3f },
57 { "alListenerfv", (ALvoid *) alListenerfv },
58 { "alListeneri", (ALvoid *) alListeneri },
59 { "alListener3i", (ALvoid *) alListener3i },
60 { "alListeneriv", (ALvoid *) alListeneriv },
61 { "alGetListenerf", (ALvoid *) alGetListenerf },
62 { "alGetListener3f", (ALvoid *) alGetListener3f },
63 { "alGetListenerfv", (ALvoid *) alGetListenerfv },
64 { "alGetListeneri", (ALvoid *) alGetListeneri },
65 { "alGetListener3i", (ALvoid *) alGetListener3i },
66 { "alGetListeneriv", (ALvoid *) alGetListeneriv },
67 { "alGenSources", (ALvoid *) alGenSources },
68 { "alDeleteSources", (ALvoid *) alDeleteSources },
69 { "alIsSource", (ALvoid *) alIsSource },
70 { "alSourcef", (ALvoid *) alSourcef },
71 { "alSource3f", (ALvoid *) alSource3f },
72 { "alSourcefv", (ALvoid *) alSourcefv },
73 { "alSourcei", (ALvoid *) alSourcei },
74 { "alSource3i", (ALvoid *) alSource3i },
75 { "alSourceiv", (ALvoid *) alSourceiv },
76 { "alGetSourcef", (ALvoid *) alGetSourcef },
77 { "alGetSource3f", (ALvoid *) alGetSource3f },
78 { "alGetSourcefv", (ALvoid *) alGetSourcefv },
79 { "alGetSourcei", (ALvoid *) alGetSourcei },
80 { "alGetSource3i", (ALvoid *) alGetSource3i },
81 { "alGetSourceiv", (ALvoid *) alGetSourceiv },
82 { "alSourcePlayv", (ALvoid *) alSourcePlayv },
83 { "alSourceStopv", (ALvoid *) alSourceStopv },
84 { "alSourceRewindv", (ALvoid *) alSourceRewindv },
85 { "alSourcePausev", (ALvoid *) alSourcePausev },
86 { "alSourcePlay", (ALvoid *) alSourcePlay },
87 { "alSourceStop", (ALvoid *) alSourceStop },
88 { "alSourceRewind", (ALvoid *) alSourceRewind },
89 { "alSourcePause", (ALvoid *) alSourcePause },
90 { "alSourceQueueBuffers", (ALvoid *) alSourceQueueBuffers },
91 { "alSourceUnqueueBuffers", (ALvoid *) alSourceUnqueueBuffers },
92 { "alGenBuffers", (ALvoid *) alGenBuffers },
93 { "alDeleteBuffers", (ALvoid *) alDeleteBuffers },
94 { "alIsBuffer", (ALvoid *) alIsBuffer },
95 { "alBufferData", (ALvoid *) alBufferData },
96 { "alBufferf", (ALvoid *) alBufferf },
97 { "alBuffer3f", (ALvoid *) alBuffer3f },
98 { "alBufferfv", (ALvoid *) alBufferfv },
99 { "alBufferi", (ALvoid *) alBufferi },
100 { "alBuffer3i", (ALvoid *) alBuffer3i },
101 { "alBufferiv", (ALvoid *) alBufferiv },
102 { "alGetBufferf", (ALvoid *) alGetBufferf },
103 { "alGetBuffer3f", (ALvoid *) alGetBuffer3f },
104 { "alGetBufferfv", (ALvoid *) alGetBufferfv },
105 { "alGetBufferi", (ALvoid *) alGetBufferi },
106 { "alGetBuffer3i", (ALvoid *) alGetBuffer3i },
107 { "alGetBufferiv", (ALvoid *) alGetBufferiv },
108 { "alDopplerFactor", (ALvoid *) alDopplerFactor },
109 { "alDopplerVelocity", (ALvoid *) alDopplerVelocity },
110 { "alSpeedOfSound", (ALvoid *) alSpeedOfSound },
111 { "alDistanceModel", (ALvoid *) alDistanceModel },
113 { "alGenFilters", (ALvoid *) alGenFilters },
114 { "alDeleteFilters", (ALvoid *) alDeleteFilters },
115 { "alIsFilter", (ALvoid *) alIsFilter },
116 { "alFilteri", (ALvoid *) alFilteri },
117 { "alFilteriv", (ALvoid *) alFilteriv },
118 { "alFilterf", (ALvoid *) alFilterf },
119 { "alFilterfv", (ALvoid *) alFilterfv },
120 { "alGetFilteri", (ALvoid *) alGetFilteri },
121 { "alGetFilteriv", (ALvoid *) alGetFilteriv },
122 { "alGetFilterf", (ALvoid *) alGetFilterf },
123 { "alGetFilterfv", (ALvoid *) alGetFilterfv },
125 { "alGenEffects", (ALvoid *) alGenEffects },
126 { "alDeleteEffects", (ALvoid *) alDeleteEffects },
127 { "alIsEffect", (ALvoid *) alIsEffect },
128 { "alEffecti", (ALvoid *) alEffecti },
129 { "alEffectiv", (ALvoid *) alEffectiv },
130 { "alEffectf", (ALvoid *) alEffectf },
131 { "alEffectfv", (ALvoid *) alEffectfv },
132 { "alGetEffecti", (ALvoid *) alGetEffecti },
133 { "alGetEffectiv", (ALvoid *) alGetEffectiv },
134 { "alGetEffectf", (ALvoid *) alGetEffectf },
135 { "alGetEffectfv", (ALvoid *) alGetEffectfv },
137 { "alGenAuxiliaryEffectSlots", (ALvoid *) alGenAuxiliaryEffectSlots },
138 { "alDeleteAuxiliaryEffectSlots",(ALvoid *) alDeleteAuxiliaryEffectSlots},
139 { "alIsAuxiliaryEffectSlot", (ALvoid *) alIsAuxiliaryEffectSlot },
140 { "alAuxiliaryEffectSloti", (ALvoid *) alAuxiliaryEffectSloti },
141 { "alAuxiliaryEffectSlotiv", (ALvoid *) alAuxiliaryEffectSlotiv },
142 { "alAuxiliaryEffectSlotf", (ALvoid *) alAuxiliaryEffectSlotf },
143 { "alAuxiliaryEffectSlotfv", (ALvoid *) alAuxiliaryEffectSlotfv },
144 { "alGetAuxiliaryEffectSloti", (ALvoid *) alGetAuxiliaryEffectSloti },
145 { "alGetAuxiliaryEffectSlotiv", (ALvoid *) alGetAuxiliaryEffectSlotiv},
146 { "alGetAuxiliaryEffectSlotf", (ALvoid *) alGetAuxiliaryEffectSlotf },
147 { "alGetAuxiliaryEffectSlotfv", (ALvoid *) alGetAuxiliaryEffectSlotfv},
149 { "alBufferSubDataEXT", (ALvoid *) alBufferSubDataEXT },
151 { "alGenDatabuffersEXT", (ALvoid *) alGenDatabuffersEXT },
152 { "alDeleteDatabuffersEXT", (ALvoid *) alDeleteDatabuffersEXT },
153 { "alIsDatabufferEXT", (ALvoid *) alIsDatabufferEXT },
154 { "alDatabufferDataEXT", (ALvoid *) alDatabufferDataEXT },
155 { "alDatabufferSubDataEXT", (ALvoid *) alDatabufferSubDataEXT },
156 { "alGetDatabufferSubDataEXT", (ALvoid *) alGetDatabufferSubDataEXT },
157 { "alDatabufferfEXT", (ALvoid *) alDatabufferfEXT },
158 { "alDatabufferfvEXT", (ALvoid *) alDatabufferfvEXT },
159 { "alDatabufferiEXT", (ALvoid *) alDatabufferiEXT },
160 { "alDatabufferivEXT", (ALvoid *) alDatabufferivEXT },
161 { "alGetDatabufferfEXT", (ALvoid *) alGetDatabufferfEXT },
162 { "alGetDatabufferfvEXT", (ALvoid *) alGetDatabufferfvEXT },
163 { "alGetDatabufferiEXT", (ALvoid *) alGetDatabufferiEXT },
164 { "alGetDatabufferivEXT", (ALvoid *) alGetDatabufferivEXT },
165 { "alSelectDatabufferEXT", (ALvoid *) alSelectDatabufferEXT },
166 { "alMapDatabufferEXT", (ALvoid *) alMapDatabufferEXT },
167 { "alUnmapDatabufferEXT", (ALvoid *) alUnmapDatabufferEXT },
169 { NULL, (ALvoid *) NULL } };
171 static ALenums enumeration[]={
172 // Types
173 { (ALchar *)"AL_INVALID", AL_INVALID },
174 { (ALchar *)"AL_NONE", AL_NONE },
175 { (ALchar *)"AL_FALSE", AL_FALSE },
176 { (ALchar *)"AL_TRUE", AL_TRUE },
178 // Source and Listener Properties
179 { (ALchar *)"AL_SOURCE_RELATIVE", AL_SOURCE_RELATIVE },
180 { (ALchar *)"AL_CONE_INNER_ANGLE", AL_CONE_INNER_ANGLE },
181 { (ALchar *)"AL_CONE_OUTER_ANGLE", AL_CONE_OUTER_ANGLE },
182 { (ALchar *)"AL_PITCH", AL_PITCH },
183 { (ALchar *)"AL_POSITION", AL_POSITION },
184 { (ALchar *)"AL_DIRECTION", AL_DIRECTION },
185 { (ALchar *)"AL_VELOCITY", AL_VELOCITY },
186 { (ALchar *)"AL_LOOPING", AL_LOOPING },
187 { (ALchar *)"AL_BUFFER", AL_BUFFER },
188 { (ALchar *)"AL_GAIN", AL_GAIN },
189 { (ALchar *)"AL_MIN_GAIN", AL_MIN_GAIN },
190 { (ALchar *)"AL_MAX_GAIN", AL_MAX_GAIN },
191 { (ALchar *)"AL_ORIENTATION", AL_ORIENTATION },
192 { (ALchar *)"AL_REFERENCE_DISTANCE", AL_REFERENCE_DISTANCE },
193 { (ALchar *)"AL_ROLLOFF_FACTOR", AL_ROLLOFF_FACTOR },
194 { (ALchar *)"AL_CONE_OUTER_GAIN", AL_CONE_OUTER_GAIN },
195 { (ALchar *)"AL_MAX_DISTANCE", AL_MAX_DISTANCE },
196 { (ALchar *)"AL_SEC_OFFSET", AL_SEC_OFFSET },
197 { (ALchar *)"AL_SAMPLE_OFFSET", AL_SAMPLE_OFFSET },
198 { (ALchar *)"AL_BYTE_OFFSET", AL_BYTE_OFFSET },
199 { (ALchar *)"AL_SOURCE_TYPE", AL_SOURCE_TYPE },
200 { (ALchar *)"AL_STATIC", AL_STATIC },
201 { (ALchar *)"AL_STREAMING", AL_STREAMING },
202 { (ALchar *)"AL_UNDETERMINED", AL_UNDETERMINED },
203 { (ALchar *)"AL_METERS_PER_UNIT", AL_METERS_PER_UNIT },
205 // Source EFX Properties
206 { (ALchar *)"AL_DIRECT_FILTER", AL_DIRECT_FILTER },
207 { (ALchar *)"AL_AUXILIARY_SEND_FILTER", AL_AUXILIARY_SEND_FILTER },
208 { (ALchar *)"AL_AIR_ABSORPTION_FACTOR", AL_AIR_ABSORPTION_FACTOR },
209 { (ALchar *)"AL_ROOM_ROLLOFF_FACTOR", AL_ROOM_ROLLOFF_FACTOR },
210 { (ALchar *)"AL_CONE_OUTER_GAINHF", AL_CONE_OUTER_GAINHF },
211 { (ALchar *)"AL_DIRECT_FILTER_GAINHF_AUTO", AL_DIRECT_FILTER_GAINHF_AUTO },
212 { (ALchar *)"AL_AUXILIARY_SEND_FILTER_GAIN_AUTO", AL_AUXILIARY_SEND_FILTER_GAIN_AUTO },
213 { (ALchar *)"AL_AUXILIARY_SEND_FILTER_GAINHF_AUTO", AL_AUXILIARY_SEND_FILTER_GAINHF_AUTO},
216 // Source State information
217 { (ALchar *)"AL_SOURCE_STATE", AL_SOURCE_STATE },
218 { (ALchar *)"AL_INITIAL", AL_INITIAL },
219 { (ALchar *)"AL_PLAYING", AL_PLAYING },
220 { (ALchar *)"AL_PAUSED", AL_PAUSED },
221 { (ALchar *)"AL_STOPPED", AL_STOPPED },
223 // Queue information
224 { (ALchar *)"AL_BUFFERS_QUEUED", AL_BUFFERS_QUEUED },
225 { (ALchar *)"AL_BUFFERS_PROCESSED", AL_BUFFERS_PROCESSED },
227 // Buffer Formats
228 { (ALchar *)"AL_FORMAT_MONO8", AL_FORMAT_MONO8 },
229 { (ALchar *)"AL_FORMAT_MONO16", AL_FORMAT_MONO16 },
230 { (ALchar *)"AL_FORMAT_MONO_FLOAT32", AL_FORMAT_MONO_FLOAT32 },
231 { (ALchar *)"AL_FORMAT_MONO_DOUBLE_EXT", AL_FORMAT_MONO_DOUBLE_EXT },
232 { (ALchar *)"AL_FORMAT_STEREO8", AL_FORMAT_STEREO8 },
233 { (ALchar *)"AL_FORMAT_STEREO16", AL_FORMAT_STEREO16 },
234 { (ALchar *)"AL_FORMAT_STEREO_FLOAT32", AL_FORMAT_STEREO_FLOAT32 },
235 { (ALchar *)"AL_FORMAT_STEREO_DOUBLE_EXT", AL_FORMAT_STEREO_DOUBLE_EXT },
236 { (ALchar *)"AL_FORMAT_MONO_IMA4", AL_FORMAT_MONO_IMA4 },
237 { (ALchar *)"AL_FORMAT_STEREO_IMA4", AL_FORMAT_STEREO_IMA4 },
238 { (ALchar *)"AL_FORMAT_QUAD8_LOKI", AL_FORMAT_QUAD8_LOKI },
239 { (ALchar *)"AL_FORMAT_QUAD16_LOKI", AL_FORMAT_QUAD16_LOKI },
240 { (ALchar *)"AL_FORMAT_QUAD8", AL_FORMAT_QUAD8 },
241 { (ALchar *)"AL_FORMAT_QUAD16", AL_FORMAT_QUAD16 },
242 { (ALchar *)"AL_FORMAT_QUAD32", AL_FORMAT_QUAD32 },
243 { (ALchar *)"AL_FORMAT_51CHN8", AL_FORMAT_51CHN8 },
244 { (ALchar *)"AL_FORMAT_51CHN16", AL_FORMAT_51CHN16 },
245 { (ALchar *)"AL_FORMAT_51CHN32", AL_FORMAT_51CHN32 },
246 { (ALchar *)"AL_FORMAT_61CHN8", AL_FORMAT_61CHN8 },
247 { (ALchar *)"AL_FORMAT_61CHN16", AL_FORMAT_61CHN16 },
248 { (ALchar *)"AL_FORMAT_61CHN32", AL_FORMAT_61CHN32 },
249 { (ALchar *)"AL_FORMAT_71CHN8", AL_FORMAT_71CHN8 },
250 { (ALchar *)"AL_FORMAT_71CHN16", AL_FORMAT_71CHN16 },
251 { (ALchar *)"AL_FORMAT_71CHN32", AL_FORMAT_71CHN32 },
252 { (ALchar *)"AL_FORMAT_REAR8", AL_FORMAT_REAR8 },
253 { (ALchar *)"AL_FORMAT_REAR16", AL_FORMAT_REAR16 },
254 { (ALchar *)"AL_FORMAT_REAR32", AL_FORMAT_REAR32 },
255 { (ALchar *)"AL_FORMAT_MONO_MULAW", AL_FORMAT_MONO_MULAW },
256 { (ALchar *)"AL_FORMAT_STEREO_MULAW", AL_FORMAT_STEREO_MULAW },
257 { (ALchar *)"AL_FORMAT_QUAD_MULAW", AL_FORMAT_QUAD_MULAW },
258 { (ALchar *)"AL_FORMAT_51CHN_MULAW", AL_FORMAT_51CHN_MULAW },
259 { (ALchar *)"AL_FORMAT_61CHN_MULAW", AL_FORMAT_61CHN_MULAW },
260 { (ALchar *)"AL_FORMAT_71CHN_MULAW", AL_FORMAT_71CHN_MULAW },
261 { (ALchar *)"AL_FORMAT_REAR_MULAW", AL_FORMAT_REAR_MULAW },
263 // Buffer attributes
264 { (ALchar *)"AL_FREQUENCY", AL_FREQUENCY },
265 { (ALchar *)"AL_BITS", AL_BITS },
266 { (ALchar *)"AL_CHANNELS", AL_CHANNELS },
267 { (ALchar *)"AL_SIZE", AL_SIZE },
269 // Buffer States (not supported yet)
270 { (ALchar *)"AL_UNUSED", AL_UNUSED },
271 { (ALchar *)"AL_PENDING", AL_PENDING },
272 { (ALchar *)"AL_PROCESSED", AL_PROCESSED },
274 // AL Error Messages
275 { (ALchar *)"AL_NO_ERROR", AL_NO_ERROR },
276 { (ALchar *)"AL_INVALID_NAME", AL_INVALID_NAME },
277 { (ALchar *)"AL_INVALID_ENUM", AL_INVALID_ENUM },
278 { (ALchar *)"AL_INVALID_VALUE", AL_INVALID_VALUE },
279 { (ALchar *)"AL_INVALID_OPERATION", AL_INVALID_OPERATION },
280 { (ALchar *)"AL_OUT_OF_MEMORY", AL_OUT_OF_MEMORY },
282 // Context strings
283 { (ALchar *)"AL_VENDOR", AL_VENDOR },
284 { (ALchar *)"AL_VERSION", AL_VERSION },
285 { (ALchar *)"AL_RENDERER", AL_RENDERER },
286 { (ALchar *)"AL_EXTENSIONS", AL_EXTENSIONS },
288 // Global states
289 { (ALchar *)"AL_DOPPLER_FACTOR", AL_DOPPLER_FACTOR },
290 { (ALchar *)"AL_DOPPLER_VELOCITY", AL_DOPPLER_VELOCITY },
291 { (ALchar *)"AL_DISTANCE_MODEL", AL_DISTANCE_MODEL },
292 { (ALchar *)"AL_SPEED_OF_SOUND", AL_SPEED_OF_SOUND },
294 // Distance Models
295 { (ALchar *)"AL_INVERSE_DISTANCE", AL_INVERSE_DISTANCE },
296 { (ALchar *)"AL_INVERSE_DISTANCE_CLAMPED", AL_INVERSE_DISTANCE_CLAMPED },
297 { (ALchar *)"AL_LINEAR_DISTANCE", AL_LINEAR_DISTANCE },
298 { (ALchar *)"AL_LINEAR_DISTANCE_CLAMPED", AL_LINEAR_DISTANCE_CLAMPED },
299 { (ALchar *)"AL_EXPONENT_DISTANCE", AL_EXPONENT_DISTANCE },
300 { (ALchar *)"AL_EXPONENT_DISTANCE_CLAMPED", AL_EXPONENT_DISTANCE_CLAMPED },
302 // Filter types
303 { (ALchar *)"AL_FILTER_TYPE", AL_FILTER_TYPE },
304 { (ALchar *)"AL_FILTER_NULL", AL_FILTER_NULL },
305 { (ALchar *)"AL_FILTER_LOWPASS", AL_FILTER_LOWPASS },
306 { (ALchar *)"AL_FILTER_HIGHPASS", AL_FILTER_HIGHPASS },
307 { (ALchar *)"AL_FILTER_BANDPASS", AL_FILTER_BANDPASS },
309 // Filter params
310 { (ALchar *)"AL_LOWPASS_GAIN", AL_LOWPASS_GAIN },
311 { (ALchar *)"AL_LOWPASS_GAINHF", AL_LOWPASS_GAINHF },
313 // Effect types
314 { (ALchar *)"AL_EFFECT_TYPE", AL_EFFECT_TYPE },
315 { (ALchar *)"AL_EFFECT_NULL", AL_EFFECT_NULL },
316 { (ALchar *)"AL_EFFECT_REVERB", AL_EFFECT_REVERB },
317 { (ALchar *)"AL_EFFECT_CHORUS", AL_EFFECT_CHORUS },
318 { (ALchar *)"AL_EFFECT_DISTORTION", AL_EFFECT_DISTORTION },
319 { (ALchar *)"AL_EFFECT_ECHO", AL_EFFECT_ECHO },
320 { (ALchar *)"AL_EFFECT_FLANGER", AL_EFFECT_FLANGER },
321 { (ALchar *)"AL_EFFECT_FREQUENCY_SHIFTER", AL_EFFECT_FREQUENCY_SHIFTER },
322 { (ALchar *)"AL_EFFECT_VOCAL_MORPHER", AL_EFFECT_VOCAL_MORPHER },
323 { (ALchar *)"AL_EFFECT_PITCH_SHIFTER", AL_EFFECT_PITCH_SHIFTER },
324 { (ALchar *)"AL_EFFECT_RING_MODULATOR", AL_EFFECT_RING_MODULATOR },
325 { (ALchar *)"AL_EFFECT_AUTOWAH", AL_EFFECT_AUTOWAH },
326 { (ALchar *)"AL_EFFECT_COMPRESSOR", AL_EFFECT_COMPRESSOR },
327 { (ALchar *)"AL_EFFECT_EQUALIZER", AL_EFFECT_EQUALIZER },
329 // Reverb params
330 { (ALchar *)"AL_REVERB_DENSITY", AL_REVERB_DENSITY },
331 { (ALchar *)"AL_REVERB_DIFFUSION", AL_REVERB_DIFFUSION },
332 { (ALchar *)"AL_REVERB_GAIN", AL_REVERB_GAIN },
333 { (ALchar *)"AL_REVERB_GAINHF", AL_REVERB_GAINHF },
334 { (ALchar *)"AL_REVERB_DECAY_TIME", AL_REVERB_DECAY_TIME },
335 { (ALchar *)"AL_REVERB_DECAY_HFRATIO", AL_REVERB_DECAY_HFRATIO },
336 { (ALchar *)"AL_REVERB_REFLECTIONS_GAIN", AL_REVERB_REFLECTIONS_GAIN },
337 { (ALchar *)"AL_REVERB_REFLECTIONS_DELAY", AL_REVERB_REFLECTIONS_DELAY },
338 { (ALchar *)"AL_REVERB_LATE_REVERB_GAIN", AL_REVERB_LATE_REVERB_GAIN },
339 { (ALchar *)"AL_REVERB_LATE_REVERB_DELAY", AL_REVERB_LATE_REVERB_DELAY },
340 { (ALchar *)"AL_REVERB_AIR_ABSORPTION_GAINHF", AL_REVERB_AIR_ABSORPTION_GAINHF },
341 { (ALchar *)"AL_REVERB_ROOM_ROLLOFF_FACTOR", AL_REVERB_ROOM_ROLLOFF_FACTOR },
342 { (ALchar *)"AL_REVERB_DECAY_HFLIMIT", AL_REVERB_DECAY_HFLIMIT },
345 // Default
346 { (ALchar *)NULL, (ALenum)0 }
351 ALAPI ALboolean ALAPIENTRY alIsExtensionPresent(const ALchar *extName)
353 ALboolean bIsSupported = AL_FALSE;
354 ALCcontext *pContext;
355 const char *ptr;
356 size_t len;
358 if (!extName)
360 alSetError(AL_INVALID_VALUE);
361 return AL_FALSE;
364 pContext = GetContextSuspended();
365 if(!pContext) return AL_FALSE;
367 len = strlen(extName);
368 ptr = pContext->ExtensionList;
369 while(ptr && *ptr)
371 if(strncasecmp(ptr, extName, len) == 0 &&
372 (ptr[len] == '\0' || isspace(ptr[len])))
374 bIsSupported = AL_TRUE;
375 break;
377 if((ptr=strchr(ptr, ' ')) != NULL)
379 do {
380 ++ptr;
381 } while(isspace(*ptr));
385 ProcessContext(pContext);
387 return bIsSupported;
391 ALAPI ALvoid * ALAPIENTRY alGetProcAddress(const ALchar *funcName)
393 ALsizei i = 0;
395 while(function[i].funcName &&
396 strcmp((char*)function[i].funcName, (char*)funcName) != 0)
397 i++;
399 return function[i].address;
402 /* NOTE: This function must be able to run without a context! */
403 ALAPI ALenum ALAPIENTRY alGetEnumValue(const ALchar *enumName)
405 ALsizei i = 0;
407 while(enumeration[i].enumName &&
408 strcmp(enumeration[i].enumName, enumName) != 0)
409 i++;
411 return enumeration[i].value;