2 * OpenAL32.dll thunk. Wraps Win32 OpenAL function calls around a native
5 * Copyright 2007 Nick Burns (adger44@hotmail.com)
6 * Copyright 2007,2009 Chris Robinson
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
31 #elif defined(HAVE_OPENAL_AL_H)
32 #include <OpenAL/al.h>
33 #include <OpenAL/alc.h>
38 #include "wine/debug.h"
40 WINE_DEFAULT_DEBUG_CHANNEL(openal32
);
42 static ALCboolean (ALC_APIENTRY
*alcSetThreadContext
)(ALCcontext
*context
);
43 static ALCcontext
* (ALC_APIENTRY
*alcGetThreadContext
)(ALCvoid
);
45 static ALboolean loaded_procs
;
47 static ALvoid (AL_APIENTRY
*alBufferDataStatic
)(const ALuint bid
, ALenum format
, const ALvoid
* data
, ALsizei size
, ALsizei freq
);
48 static ALvoid (AL_APIENTRY
*alGenFilters
)(ALsizei n
, ALuint
* filters
);
49 static ALvoid (AL_APIENTRY
*alDeleteFilters
)(ALsizei n
, const ALuint
* filters
);
50 static ALboolean (AL_APIENTRY
*alIsFilter
)(ALuint fid
);
51 static ALvoid (AL_APIENTRY
*alFilterf
)(ALuint fid
, ALenum param
, ALfloat value
);
52 static ALvoid (AL_APIENTRY
*alFilterfv
)(ALuint fid
, ALenum param
, const ALfloat
* values
);
53 static ALvoid (AL_APIENTRY
*alFilteri
)(ALuint fid
, ALenum param
, ALint value
);
54 static ALvoid (AL_APIENTRY
*alFilteriv
)(ALuint fid
, ALenum param
, const ALint
* values
);
55 static ALvoid (AL_APIENTRY
*alGetFilterf
)(ALuint fid
, ALenum param
, ALfloat
* value
);
56 static ALvoid (AL_APIENTRY
*alGetFilterfv
)(ALuint fid
, ALenum param
, ALfloat
* values
);
57 static ALvoid (AL_APIENTRY
*alGetFilteri
)(ALuint fid
, ALenum param
, ALint
* value
);
58 static ALvoid (AL_APIENTRY
*alGetFilteriv
)(ALuint fid
, ALenum param
, ALint
* values
);
59 static ALvoid (AL_APIENTRY
*alGenEffects
)(ALsizei n
, ALuint
* effects
);
60 static ALvoid (AL_APIENTRY
*alDeleteEffects
)(ALsizei n
, const ALuint
* effects
);
61 static ALboolean (AL_APIENTRY
*alIsEffect
)(ALuint eid
);
62 static ALvoid (AL_APIENTRY
*alEffectf
)(ALuint eid
, ALenum param
, ALfloat value
);
63 static ALvoid (AL_APIENTRY
*alEffectfv
)(ALuint eid
, ALenum param
, const ALfloat
* values
);
64 static ALvoid (AL_APIENTRY
*alEffecti
)(ALuint eid
, ALenum param
, ALint value
);
65 static ALvoid (AL_APIENTRY
*alEffectiv
)(ALuint eid
, ALenum param
, const ALint
* values
);
66 static ALvoid (AL_APIENTRY
*alGetEffectf
)(ALuint eid
, ALenum param
, ALfloat
* value
);
67 static ALvoid (AL_APIENTRY
*alGetEffectfv
)(ALuint eid
, ALenum param
, ALfloat
* values
);
68 static ALvoid (AL_APIENTRY
*alGetEffecti
)(ALuint eid
, ALenum param
, ALint
* value
);
69 static ALvoid (AL_APIENTRY
*alGetEffectiv
)(ALuint eid
, ALenum param
, ALint
* values
);
70 static ALvoid (AL_APIENTRY
*alGenAuxiliaryEffectSlots
)(ALsizei n
, ALuint
* slots
);
71 static ALvoid (AL_APIENTRY
*alDeleteAuxiliaryEffectSlots
)(ALsizei n
, const ALuint
* slots
);
72 static ALboolean (AL_APIENTRY
*alIsAuxiliaryEffectSlot
)(ALuint sid
);
73 static ALvoid (AL_APIENTRY
*alAuxiliaryEffectSlotf
)(ALuint sid
, ALenum param
, ALfloat value
);
74 static ALvoid (AL_APIENTRY
*alAuxiliaryEffectSlotfv
)(ALuint sid
, ALenum param
, const ALfloat
* values
);
75 static ALvoid (AL_APIENTRY
*alAuxiliaryEffectSloti
)(ALuint sid
, ALenum param
, ALint value
);
76 static ALvoid (AL_APIENTRY
*alAuxiliaryEffectSlotiv
)(ALuint sid
, ALenum param
, const ALint
* values
);
77 static ALvoid (AL_APIENTRY
*alGetAuxiliaryEffectSlotf
)(ALuint sid
, ALenum param
, ALfloat
* value
);
78 static ALvoid (AL_APIENTRY
*alGetAuxiliaryEffectSlotfv
)(ALuint sid
, ALenum param
, ALfloat
* values
);
79 static ALvoid (AL_APIENTRY
*alGetAuxiliaryEffectSloti
)(ALuint sid
, ALenum param
, ALint
* value
);
80 static ALvoid (AL_APIENTRY
*alGetAuxiliaryEffectSlotiv
)(ALuint sid
, ALenum param
, ALint
* values
);
82 extern ALCvoid
* CDECL
wine_alcGetProcAddress(ALCdevice
*, const ALCchar
*);
83 extern ALvoid
* CDECL
wine_alGetProcAddress(const ALchar
*);
85 static CRITICAL_SECTION openal_cs
;
86 static CRITICAL_SECTION_DEBUG openal_cs_debug
=
89 {&openal_cs_debug
.ProcessLocksList
,
90 &openal_cs_debug
.ProcessLocksList
},
91 0, 0, {(DWORD_PTR
)(__FILE__
": openal_cs")}
93 static CRITICAL_SECTION openal_cs
= {&openal_cs_debug
, -1, 0, 0, 0, 0};
95 /***********************************************************************
96 * OpenAL initialisation routine
98 BOOL WINAPI
DllMain( HINSTANCE hinst
, DWORD reason
, LPVOID reserved
)
102 case DLL_PROCESS_ATTACH
:
103 DisableThreadLibraryCalls(hinst
);
104 #define LOADFUNC(x) x = alcGetProcAddress(NULL, #x)
105 LOADFUNC(alcSetThreadContext
);
106 LOADFUNC(alcGetThreadContext
);
115 static void LoadProcs(void)
117 #define LOADFUNC(x) x = alGetProcAddress(#x)
118 LOADFUNC(alBufferDataStatic
);
119 LOADFUNC(alGenFilters
);
120 LOADFUNC(alDeleteFilters
);
121 LOADFUNC(alIsFilter
);
123 LOADFUNC(alFilterfv
);
125 LOADFUNC(alFilteriv
);
126 LOADFUNC(alGetFilterf
);
127 LOADFUNC(alGetFilterfv
);
128 LOADFUNC(alGetFilteri
);
129 LOADFUNC(alGetFilteriv
);
130 LOADFUNC(alGenEffects
);
131 LOADFUNC(alDeleteEffects
);
132 LOADFUNC(alIsEffect
);
134 LOADFUNC(alEffectfv
);
136 LOADFUNC(alEffectiv
);
137 LOADFUNC(alGetEffectf
);
138 LOADFUNC(alGetEffectfv
);
139 LOADFUNC(alGetEffecti
);
140 LOADFUNC(alGetEffectiv
);
141 LOADFUNC(alGenAuxiliaryEffectSlots
);
142 LOADFUNC(alDeleteAuxiliaryEffectSlots
);
143 LOADFUNC(alIsAuxiliaryEffectSlot
);
144 LOADFUNC(alAuxiliaryEffectSlotf
);
145 LOADFUNC(alAuxiliaryEffectSlotfv
);
146 LOADFUNC(alAuxiliaryEffectSloti
);
147 LOADFUNC(alAuxiliaryEffectSlotiv
);
148 LOADFUNC(alGetAuxiliaryEffectSlotf
);
149 LOADFUNC(alGetAuxiliaryEffectSlotfv
);
150 LOADFUNC(alGetAuxiliaryEffectSloti
);
151 LOADFUNC(alGetAuxiliaryEffectSlotiv
);
155 /***********************************************************************
156 * OpenAL thunk routines
159 /* OpenAL ALC 1.0 functions */
160 ALCcontext
* CDECL
wine_alcCreateContext(ALCdevice
*device
, const ALCint
* attrlist
)
162 return alcCreateContext(device
, attrlist
);
165 ALCboolean CDECL
wine_alcMakeContextCurrent(ALCcontext
*context
)
167 EnterCriticalSection(&openal_cs
);
168 if(alcMakeContextCurrent(context
) == ALC_FALSE
)
170 WARN("Failed to make context %p current\n", context
);
171 LeaveCriticalSection(&openal_cs
);
175 if(context
&& !loaded_procs
)
177 loaded_procs
= AL_TRUE
;
180 LeaveCriticalSection(&openal_cs
);
185 ALvoid CDECL
wine_alcProcessContext(ALCcontext
*context
)
187 alcProcessContext(context
);
190 ALvoid CDECL
wine_alcSuspendContext(ALCcontext
*context
)
192 alcSuspendContext(context
);
195 ALvoid CDECL
wine_alcDestroyContext(ALCcontext
*context
)
197 alcDestroyContext(context
);
200 ALCcontext
* CDECL
wine_alcGetCurrentContext(ALCvoid
)
202 return alcGetCurrentContext();
205 ALCdevice
* CDECL
wine_alcGetContextsDevice(ALCcontext
*context
)
207 return alcGetContextsDevice(context
);
210 ALCdevice
* CDECL
wine_alcOpenDevice(const ALCchar
*devicename
)
212 if(devicename
!= NULL
&& (strcmp(devicename
, "DirectSound3D") == 0 ||
213 strcmp(devicename
, "DirectSound") == 0 ||
214 strcmp(devicename
, "Generic Hardware") == 0 ||
215 strcmp(devicename
, "Generic Software") == 0)) {
218 return alcOpenDevice(devicename
);
221 ALCboolean CDECL
wine_alcCloseDevice(ALCdevice
*device
)
223 return alcCloseDevice(device
);
226 ALCenum CDECL
wine_alcGetError(ALCdevice
*device
)
228 return alcGetError(device
);
231 ALCboolean CDECL
wine_alcIsExtensionPresent(ALCdevice
*device
, const ALCchar
*extname
)
233 return alcIsExtensionPresent(device
, extname
);
236 ALCenum CDECL
wine_alcGetEnumValue(ALCdevice
*device
, const ALCchar
*enumname
)
238 return alcGetEnumValue(device
, enumname
);
241 const ALCchar
* CDECL
wine_alcGetString(ALCdevice
*device
, ALCenum param
)
243 return alcGetString(device
, param
);
246 ALvoid CDECL
wine_alcGetIntegerv(ALCdevice
*device
, ALCenum param
, ALCsizei size
, ALCint
*dest
)
248 alcGetIntegerv(device
, param
, size
, dest
);
252 /* OpenAL 1.0 functions */
253 ALvoid CDECL
wine_alEnable(ALenum capability
)
255 alEnable(capability
);
258 ALvoid CDECL
wine_alDisable(ALenum capability
)
260 alDisable(capability
);
263 ALboolean CDECL
wine_alIsEnabled(ALenum capability
)
265 return alIsEnabled(capability
);
268 const ALchar
* CDECL
wine_alGetString(ALenum param
)
270 return alGetString(param
);
273 ALvoid CDECL
wine_alGetBooleanv(ALenum param
, ALboolean
* data
)
275 alGetBooleanv(param
, data
);
278 ALvoid CDECL
wine_alGetIntegerv(ALenum param
, ALint
* data
)
280 alGetIntegerv(param
, data
);
283 ALvoid CDECL
wine_alGetFloatv(ALenum param
, ALfloat
* data
)
285 alGetFloatv(param
, data
);
288 ALvoid CDECL
wine_alGetDoublev(ALenum param
, ALdouble
* data
)
290 alGetDoublev(param
, data
);
293 ALboolean CDECL
wine_alGetBoolean(ALenum param
)
295 return alGetBoolean(param
);
298 ALint CDECL
wine_alGetInteger(ALenum param
)
300 return alGetInteger(param
);
303 ALfloat CDECL
wine_alGetFloat(ALenum param
)
305 return alGetFloat(param
);
308 ALdouble CDECL
wine_alGetDouble(ALenum param
)
310 return alGetDouble(param
);
313 ALenum CDECL
wine_alGetError(ALvoid
)
318 ALboolean CDECL
wine_alIsExtensionPresent(const ALchar
* extname
)
320 return alIsExtensionPresent(extname
);
323 ALenum CDECL
wine_alGetEnumValue(const ALchar
* ename
)
325 return alGetEnumValue(ename
);
328 ALvoid CDECL
wine_alListenerf(ALenum param
, ALfloat value
)
330 alListenerf(param
, value
);
333 ALvoid CDECL
wine_alListener3f(ALenum param
, ALfloat value1
, ALfloat value2
, ALfloat value3
)
335 alListener3f(param
, value1
, value2
, value3
);
338 ALvoid CDECL
wine_alListenerfv(ALenum param
, const ALfloat
* values
)
340 alListenerfv(param
, values
);
343 ALvoid CDECL
wine_alListeneri(ALenum param
, ALint value
)
345 alListeneri(param
, value
);
348 ALvoid CDECL
wine_alGetListenerf(ALenum param
, ALfloat
* value
)
350 alGetListenerf(param
, value
);
353 ALvoid CDECL
wine_alGetListener3f(ALenum param
, ALfloat
*value1
, ALfloat
*value2
, ALfloat
*value3
)
355 alGetListener3f(param
, value1
, value2
, value3
);
358 ALvoid CDECL
wine_alGetListenerfv(ALenum param
, ALfloat
* values
)
360 alGetListenerfv(param
, values
);
363 ALvoid CDECL
wine_alGetListeneri(ALenum param
, ALint
* value
)
365 alGetListeneri(param
, value
);
368 ALvoid CDECL
wine_alGetListeneriv(ALenum param
, ALint
* values
)
370 alGetListeneriv(param
, values
);
373 ALvoid CDECL
wine_alGenSources(ALsizei n
, ALuint
* sources
)
375 alGenSources(n
, sources
);
378 ALvoid CDECL
wine_alDeleteSources(ALsizei n
, const ALuint
* sources
)
380 alDeleteSources(n
, sources
);
383 ALboolean CDECL
wine_alIsSource(ALuint sid
)
385 return alIsSource(sid
);
388 ALvoid CDECL
wine_alSourcef(ALuint sid
, ALenum param
, ALfloat value
)
390 alSourcef(sid
, param
, value
);
393 ALvoid CDECL
wine_alSource3f(ALuint sid
, ALenum param
, ALfloat value1
, ALfloat value2
, ALfloat value3
)
395 alSource3f(sid
, param
, value1
, value2
, value3
);
398 ALvoid CDECL
wine_alSourcefv(ALuint sid
, ALenum param
, const ALfloat
* values
)
400 alSourcefv(sid
, param
, values
);
403 ALvoid CDECL
wine_alSourcei(ALuint sid
, ALenum param
, ALint value
)
405 alSourcei(sid
, param
, value
);
408 ALvoid CDECL
wine_alGetSourcef(ALuint sid
, ALenum param
, ALfloat
* value
)
410 alGetSourcef(sid
, param
, value
);
413 ALvoid CDECL
wine_alGetSource3f(ALuint sid
, ALenum param
, ALfloat
* value1
, ALfloat
* value2
, ALfloat
* value3
)
415 alGetSource3f(sid
, param
, value1
, value2
, value3
);
418 ALvoid CDECL
wine_alGetSourcefv(ALuint sid
, ALenum param
, ALfloat
* values
)
420 alGetSourcefv(sid
, param
, values
);
423 ALvoid CDECL
wine_alGetSourcei(ALuint sid
, ALenum param
, ALint
* value
)
425 alGetSourcei(sid
, param
, value
);
428 ALvoid CDECL
wine_alGetSourceiv(ALuint sid
, ALenum param
, ALint
* values
)
430 alGetSourceiv(sid
, param
, values
);
433 ALvoid CDECL
wine_alSourcePlayv(ALsizei ns
, const ALuint
*sids
)
435 alSourcePlayv(ns
, sids
);
438 ALvoid CDECL
wine_alSourceStopv(ALsizei ns
, const ALuint
*sids
)
440 alSourceStopv(ns
, sids
);
443 ALvoid CDECL
wine_alSourceRewindv(ALsizei ns
, const ALuint
*sids
)
445 alSourceRewindv(ns
, sids
);
448 ALvoid CDECL
wine_alSourcePausev(ALsizei ns
, const ALuint
*sids
)
450 alSourcePausev(ns
, sids
);
453 ALvoid CDECL
wine_alSourcePlay(ALuint sid
)
458 ALvoid CDECL
wine_alSourceStop(ALuint sid
)
463 ALvoid CDECL
wine_alSourceRewind(ALuint sid
)
468 ALvoid CDECL
wine_alSourcePause(ALuint sid
)
473 ALvoid CDECL
wine_alSourceQueueBuffers(ALuint sid
, ALsizei numEntries
, const ALuint
*bids
)
475 alSourceQueueBuffers(sid
, numEntries
, bids
);
478 ALvoid CDECL
wine_alSourceUnqueueBuffers(ALuint sid
, ALsizei numEntries
, ALuint
*bids
)
480 alSourceUnqueueBuffers(sid
, numEntries
, bids
);
483 ALvoid CDECL
wine_alGenBuffers(ALsizei n
, ALuint
* buffers
)
485 alGenBuffers(n
, buffers
);
488 ALvoid CDECL
wine_alDeleteBuffers(ALsizei n
, const ALuint
* buffers
)
490 alDeleteBuffers(n
, buffers
);
493 ALboolean CDECL
wine_alIsBuffer(ALuint bid
)
495 return alIsBuffer(bid
);
498 ALvoid CDECL
wine_alBufferData(ALuint bid
, ALenum format
, const ALvoid
* data
, ALsizei size
, ALsizei freq
)
500 alBufferData(bid
, format
, data
, size
, freq
);
503 static ALvoid CDECL
wine_alBufferDataStatic(const ALuint bid
, ALenum format
, const ALvoid
* data
, ALsizei size
, ALsizei freq
)
505 alBufferDataStatic(bid
, format
, data
, size
, freq
);
508 ALvoid CDECL
wine_alGetBufferf(ALuint bid
, ALenum param
, ALfloat
* value
)
510 alGetBufferf(bid
, param
, value
);
513 ALvoid CDECL
wine_alGetBufferfv(ALuint bid
, ALenum param
, ALfloat
* values
)
515 alGetBufferfv(bid
, param
, values
);
518 ALvoid CDECL
wine_alGetBufferi(ALuint bid
, ALenum param
, ALint
* value
)
520 alGetBufferi(bid
, param
, value
);
523 ALvoid CDECL
wine_alGetBufferiv(ALuint bid
, ALenum param
, ALint
* values
)
525 alGetBufferiv(bid
, param
, values
);
528 ALvoid CDECL
wine_alDopplerFactor(ALfloat value
)
530 alDopplerFactor(value
);
533 ALvoid CDECL
wine_alDopplerVelocity(ALfloat value
)
535 alDopplerVelocity(value
);
538 ALvoid CDECL
wine_alDistanceModel(ALenum distanceModel
)
540 alDistanceModel(distanceModel
);
544 /* OpenAL ALC 1.1 functions */
545 ALCdevice
* CDECL
wine_alcCaptureOpenDevice(const ALCchar
*devicename
, ALCuint frequency
, ALCenum format
, ALCsizei buffersize
)
547 return alcCaptureOpenDevice(devicename
, frequency
, format
, buffersize
);
550 ALCboolean CDECL
wine_alcCaptureCloseDevice(ALCdevice
*device
)
552 return alcCaptureCloseDevice(device
);
555 ALCvoid CDECL
wine_alcCaptureStart(ALCdevice
*device
)
557 alcCaptureStart(device
);
560 ALCvoid CDECL
wine_alcCaptureStop(ALCdevice
*device
)
562 alcCaptureStop(device
);
565 ALCvoid CDECL
wine_alcCaptureSamples(ALCdevice
*device
, ALCvoid
*buffer
, ALCsizei samples
)
567 alcCaptureSamples(device
, buffer
, samples
);
570 /* OpenAL 1.1 functions */
571 ALvoid CDECL
wine_alListener3i(ALenum param
, ALint value1
, ALint value2
, ALint value3
)
573 alListener3i(param
, value1
, value2
, value3
);
576 ALvoid CDECL
wine_alListeneriv(ALenum param
, const ALint
* values
)
578 alListeneriv(param
, values
);
581 ALvoid CDECL
wine_alGetListener3i(ALenum param
, ALint
*value1
, ALint
*value2
, ALint
*value3
)
583 alGetListener3i(param
, value1
, value2
, value3
);
586 ALvoid CDECL
wine_alSource3i(ALuint sid
, ALenum param
, ALint value1
, ALint value2
, ALint value3
)
588 alSource3i(sid
, param
, value1
, value2
, value3
);
591 ALvoid CDECL
wine_alSourceiv(ALuint sid
, ALenum param
, const ALint
* values
)
593 alSourceiv(sid
, param
, values
);
596 ALvoid CDECL
wine_alGetSource3i(ALuint sid
, ALenum param
, ALint
* value1
, ALint
* value2
, ALint
* value3
)
598 alGetSource3i(sid
, param
, value1
, value2
, value3
);
601 ALvoid CDECL
wine_alBufferf(ALuint bid
, ALenum param
, ALfloat value
)
603 alBufferf(bid
, param
, value
);
606 ALvoid CDECL
wine_alBuffer3f(ALuint bid
, ALenum param
, ALfloat value1
, ALfloat value2
, ALfloat value3
)
608 alBuffer3f(bid
, param
, value1
, value2
, value3
);
611 ALvoid CDECL
wine_alBufferfv(ALuint bid
, ALenum param
, const ALfloat
* values
)
613 alBufferfv(bid
, param
, values
);
616 ALvoid CDECL
wine_alBufferi(ALuint bid
, ALenum param
, ALint value
)
618 alBufferi(bid
, param
, value
);
621 ALvoid CDECL
wine_alBuffer3i(ALuint bid
, ALenum param
, ALint value1
, ALint value2
, ALint value3
)
623 alBuffer3i(bid
, param
, value1
, value2
, value3
);
626 ALvoid CDECL
wine_alBufferiv(ALuint bid
, ALenum param
, const ALint
* values
)
628 alBufferiv(bid
, param
, values
);
631 ALvoid CDECL
wine_alGetBuffer3f(ALuint bid
, ALenum param
, ALfloat
* value1
, ALfloat
* value2
, ALfloat
* value3
)
633 alGetBuffer3f(bid
, param
, value1
, value2
, value3
);
636 ALvoid CDECL
wine_alGetBuffer3i(ALuint bid
, ALenum param
, ALint
* value1
, ALint
* value2
, ALint
* value3
)
638 alGetBuffer3i(bid
, param
, value1
, value2
, value3
);
641 ALvoid CDECL
wine_alSpeedOfSound(ALfloat value
)
643 alSpeedOfSound(value
);
646 /* OpenAL EFX extension functions */
647 static ALvoid CDECL
wine_alGenFilters(ALsizei n
, ALuint
* filters
)
649 alGenFilters(n
, filters
);
652 static ALvoid CDECL
wine_alDeleteFilters(ALsizei n
, const ALuint
* filters
)
654 alDeleteFilters(n
, filters
);
657 static ALboolean CDECL
wine_alIsFilter(ALuint fid
)
659 return alIsFilter(fid
);
662 static ALvoid CDECL
wine_alFilterf(ALuint fid
, ALenum param
, ALfloat value
)
664 alFilterf(fid
, param
, value
);
667 static ALvoid CDECL
wine_alFilterfv(ALuint fid
, ALenum param
, const ALfloat
* values
)
669 alFilterfv(fid
, param
, values
);
672 static ALvoid CDECL
wine_alFilteri(ALuint fid
, ALenum param
, ALint value
)
674 alFilteri(fid
, param
, value
);
677 static ALvoid CDECL
wine_alFilteriv(ALuint fid
, ALenum param
, const ALint
* values
)
679 alFilteriv(fid
, param
, values
);
682 static ALvoid CDECL
wine_alGetFilterf(ALuint fid
, ALenum param
, ALfloat
* value
)
684 alGetFilterf(fid
, param
, value
);
687 static ALvoid CDECL
wine_alGetFilterfv(ALuint fid
, ALenum param
, ALfloat
* values
)
689 alGetFilterfv(fid
, param
, values
);
692 static ALvoid CDECL
wine_alGetFilteri(ALuint fid
, ALenum param
, ALint
* value
)
694 alGetFilteri(fid
, param
, value
);
697 static ALvoid CDECL
wine_alGetFilteriv(ALuint fid
, ALenum param
, ALint
* values
)
699 alGetFilteriv(fid
, param
, values
);
703 static ALvoid CDECL
wine_alGenEffects(ALsizei n
, ALuint
* effects
)
705 alGenEffects(n
, effects
);
708 static ALvoid CDECL
wine_alDeleteEffects(ALsizei n
, const ALuint
* effects
)
710 alDeleteEffects(n
, effects
);
713 static ALboolean CDECL
wine_alIsEffect(ALuint eid
)
715 return alIsEffect(eid
);
718 static ALvoid CDECL
wine_alEffectf(ALuint eid
, ALenum param
, ALfloat value
)
720 alEffectf(eid
, param
, value
);
723 static ALvoid CDECL
wine_alEffectfv(ALuint eid
, ALenum param
, const ALfloat
* values
)
725 alEffectfv(eid
, param
, values
);
728 static ALvoid CDECL
wine_alEffecti(ALuint eid
, ALenum param
, ALint value
)
730 alEffecti(eid
, param
, value
);
733 static ALvoid CDECL
wine_alEffectiv(ALuint eid
, ALenum param
, const ALint
* values
)
735 alEffectiv(eid
, param
, values
);
738 static ALvoid CDECL
wine_alGetEffectf(ALuint eid
, ALenum param
, ALfloat
* value
)
740 alGetEffectf(eid
, param
, value
);
743 static ALvoid CDECL
wine_alGetEffectfv(ALuint eid
, ALenum param
, ALfloat
* values
)
745 alGetEffectfv(eid
, param
, values
);
748 static ALvoid CDECL
wine_alGetEffecti(ALuint eid
, ALenum param
, ALint
* value
)
750 alGetEffecti(eid
, param
, value
);
753 static ALvoid CDECL
wine_alGetEffectiv(ALuint eid
, ALenum param
, ALint
* values
)
755 alGetEffectiv(eid
, param
, values
);
759 static ALvoid CDECL
wine_alGenAuxiliaryEffectSlots(ALsizei n
, ALuint
* slots
)
761 alGenAuxiliaryEffectSlots(n
, slots
);
764 static ALvoid CDECL
wine_alDeleteAuxiliaryEffectSlots(ALsizei n
, const ALuint
* slots
)
766 alDeleteAuxiliaryEffectSlots(n
, slots
);
769 static ALboolean CDECL
wine_alIsAuxiliaryEffectSlot(ALuint sid
)
771 return alIsAuxiliaryEffectSlot(sid
);
774 static ALvoid CDECL
wine_alAuxiliaryEffectSlotf(ALuint sid
, ALenum param
, ALfloat value
)
776 alAuxiliaryEffectSlotf(sid
, param
, value
);
779 static ALvoid CDECL
wine_alAuxiliaryEffectSlotfv(ALuint sid
, ALenum param
, const ALfloat
* values
)
781 alAuxiliaryEffectSlotfv(sid
, param
, values
);
784 static ALvoid CDECL
wine_alAuxiliaryEffectSloti(ALuint sid
, ALenum param
, ALint value
)
786 alAuxiliaryEffectSloti(sid
, param
, value
);
789 static ALvoid CDECL
wine_alAuxiliaryEffectSlotiv(ALuint sid
, ALenum param
, const ALint
* values
)
791 alAuxiliaryEffectSlotiv(sid
, param
, values
);
794 static ALvoid CDECL
wine_alGetAuxiliaryEffectSlotf(ALuint sid
, ALenum param
, ALfloat
* value
)
796 alGetAuxiliaryEffectSlotf(sid
, param
, value
);
799 static ALvoid CDECL
wine_alGetAuxiliaryEffectSlotfv(ALuint sid
, ALenum param
, ALfloat
* values
)
801 alGetAuxiliaryEffectSlotfv(sid
, param
, values
);
804 static ALvoid CDECL
wine_alGetAuxiliaryEffectSloti(ALuint sid
, ALenum param
, ALint
* value
)
806 alGetAuxiliaryEffectSloti(sid
, param
, value
);
809 static ALvoid CDECL
wine_alGetAuxiliaryEffectSlotiv(ALuint sid
, ALenum param
, ALint
* values
)
811 alGetAuxiliaryEffectSlotiv(sid
, param
, values
);
815 /* Thread-local context functions */
816 static ALCboolean CDECL
wine_alcSetThreadContext(ALCcontext
*context
)
818 EnterCriticalSection(&openal_cs
);
819 if(alcSetThreadContext(context
) == ALC_FALSE
)
821 WARN("Failed to make context %p current\n", context
);
822 LeaveCriticalSection(&openal_cs
);
826 if(context
&& !loaded_procs
)
828 loaded_procs
= AL_TRUE
;
831 LeaveCriticalSection(&openal_cs
);
836 static ALCcontext
* CDECL
wine_alcGetThreadContext(ALCvoid
)
838 return alcGetThreadContext();
846 static const struct FuncList ALCFuncs
[] = {
847 { "alcCreateContext", wine_alcCreateContext
},
848 { "alcMakeContextCurrent", wine_alcMakeContextCurrent
},
849 { "alcProcessContext", wine_alcProcessContext
},
850 { "alcSuspendContext", wine_alcSuspendContext
},
851 { "alcDestroyContext", wine_alcDestroyContext
},
852 { "alcGetCurrentContext", wine_alcGetCurrentContext
},
853 { "alcGetContextsDevice", wine_alcGetContextsDevice
},
854 { "alcOpenDevice", wine_alcOpenDevice
},
855 { "alcCloseDevice", wine_alcCloseDevice
},
856 { "alcGetError", wine_alcGetError
},
857 { "alcIsExtensionPresent", wine_alcIsExtensionPresent
},
858 { "alcGetProcAddress", wine_alcGetProcAddress
},
859 { "alcGetEnumValue", wine_alcGetEnumValue
},
860 { "alcGetString", wine_alcGetString
},
861 { "alcGetIntegerv", wine_alcGetIntegerv
},
862 { "alcCaptureOpenDevice", wine_alcCaptureOpenDevice
},
863 { "alcCaptureCloseDevice", wine_alcCaptureCloseDevice
},
864 { "alcCaptureStart", wine_alcCaptureStart
},
865 { "alcCaptureStop", wine_alcCaptureStop
},
866 { "alcCaptureSamples", wine_alcCaptureSamples
},
867 { "alcSetThreadContext", wine_alcSetThreadContext
},
868 { "alcGetThreadContext", wine_alcGetThreadContext
},
871 static const struct FuncList ALFuncs
[] = {
872 { "alEnable", wine_alEnable
},
873 { "alDisable", wine_alDisable
},
874 { "alIsEnabled", wine_alIsEnabled
},
875 { "alGetString", wine_alGetString
},
876 { "alGetBooleanv", wine_alGetBooleanv
},
877 { "alGetIntegerv", wine_alGetIntegerv
},
878 { "alGetFloatv", wine_alGetFloatv
},
879 { "alGetDoublev", wine_alGetDoublev
},
880 { "alGetBoolean", wine_alGetBoolean
},
881 { "alGetInteger", wine_alGetInteger
},
882 { "alGetFloat", wine_alGetFloat
},
883 { "alGetDouble", wine_alGetDouble
},
884 { "alGetError", wine_alGetError
},
885 { "alIsExtensionPresent", wine_alIsExtensionPresent
},
886 { "alGetProcAddress", wine_alGetProcAddress
},
887 { "alGetEnumValue", wine_alGetEnumValue
},
888 { "alListenerf", wine_alListenerf
},
889 { "alListener3f", wine_alListener3f
},
890 { "alListenerfv", wine_alListenerfv
},
891 { "alListeneri", wine_alListeneri
},
892 { "alListener3i", wine_alListener3i
},
893 { "alListeneriv", wine_alListeneriv
},
894 { "alGetListenerf", wine_alGetListenerf
},
895 { "alGetListener3f", wine_alGetListener3f
},
896 { "alGetListenerfv", wine_alGetListenerfv
},
897 { "alGetListeneri", wine_alGetListeneri
},
898 { "alGetListener3i", wine_alGetListener3i
},
899 { "alGetListeneriv", wine_alGetListeneriv
},
900 { "alGenSources", wine_alGenSources
},
901 { "alDeleteSources", wine_alDeleteSources
},
902 { "alIsSource", wine_alIsSource
},
903 { "alSourcef", wine_alSourcef
},
904 { "alSource3f", wine_alSource3f
},
905 { "alSourcefv", wine_alSourcefv
},
906 { "alSourcei", wine_alSourcei
},
907 { "alSource3i", wine_alSource3i
},
908 { "alSourceiv", wine_alSourceiv
},
909 { "alGetSourcef", wine_alGetSourcef
},
910 { "alGetSource3f", wine_alGetSource3f
},
911 { "alGetSourcefv", wine_alGetSourcefv
},
912 { "alGetSourcei", wine_alGetSourcei
},
913 { "alGetSource3i", wine_alGetSource3i
},
914 { "alGetSourceiv", wine_alGetSourceiv
},
915 { "alSourcePlayv", wine_alSourcePlayv
},
916 { "alSourceStopv", wine_alSourceStopv
},
917 { "alSourceRewindv", wine_alSourceRewindv
},
918 { "alSourcePausev", wine_alSourcePausev
},
919 { "alSourcePlay", wine_alSourcePlay
},
920 { "alSourceStop", wine_alSourceStop
},
921 { "alSourceRewind", wine_alSourceRewind
},
922 { "alSourcePause", wine_alSourcePause
},
923 { "alSourceQueueBuffers", wine_alSourceQueueBuffers
},
924 { "alSourceUnqueueBuffers", wine_alSourceUnqueueBuffers
},
925 { "alGenBuffers", wine_alGenBuffers
},
926 { "alDeleteBuffers", wine_alDeleteBuffers
},
927 { "alIsBuffer", wine_alIsBuffer
},
928 { "alBufferData", wine_alBufferData
},
929 { "alBufferDataStatic", wine_alBufferDataStatic
},
930 { "alBufferf", wine_alBufferf
},
931 { "alBuffer3f", wine_alBuffer3f
},
932 { "alBufferfv", wine_alBufferfv
},
933 { "alBufferi", wine_alBufferi
},
934 { "alBuffer3i", wine_alBuffer3i
},
935 { "alBufferiv", wine_alBufferiv
},
936 { "alGetBufferf", wine_alGetBufferf
},
937 { "alGetBuffer3f", wine_alGetBuffer3f
},
938 { "alGetBufferfv", wine_alGetBufferfv
},
939 { "alGetBufferi", wine_alGetBufferi
},
940 { "alGetBuffer3i", wine_alGetBuffer3i
},
941 { "alGetBufferiv", wine_alGetBufferiv
},
942 { "alDopplerFactor", wine_alDopplerFactor
},
943 { "alDopplerVelocity", wine_alDopplerVelocity
},
944 { "alSpeedOfSound", wine_alSpeedOfSound
},
945 { "alDistanceModel", wine_alDistanceModel
},
947 { "alGenFilters", wine_alGenFilters
},
948 { "alDeleteFilters", wine_alDeleteFilters
},
949 { "alIsFilter", wine_alIsFilter
},
950 { "alFilterf", wine_alFilterf
},
951 { "alFilterfv", wine_alFilterfv
},
952 { "alFilteri", wine_alFilteri
},
953 { "alFilteriv", wine_alFilteriv
},
954 { "alGetFilterf", wine_alGetFilterf
},
955 { "alGetFilterfv", wine_alGetFilterfv
},
956 { "alGetFilteri", wine_alGetFilteri
},
957 { "alGetFilteriv", wine_alGetFilteriv
},
959 { "alGenEffects", wine_alGenEffects
},
960 { "alDeleteEffects", wine_alDeleteEffects
},
961 { "alIsEffect", wine_alIsEffect
},
962 { "alEffectf", wine_alEffectf
},
963 { "alEffectfv", wine_alEffectfv
},
964 { "alEffecti", wine_alEffecti
},
965 { "alEffectiv", wine_alEffectiv
},
966 { "alGetEffectf", wine_alGetEffectf
},
967 { "alGetEffectfv", wine_alGetEffectfv
},
968 { "alGetEffecti", wine_alGetEffecti
},
969 { "alGetEffectiv", wine_alGetEffectiv
},
971 { "alGenAuxiliaryEffectSlots", wine_alGenAuxiliaryEffectSlots
},
972 { "alDeleteAuxiliaryEffectSlots",wine_alDeleteAuxiliaryEffectSlots
},
973 { "alIsAuxiliaryEffectSlot", wine_alIsAuxiliaryEffectSlot
},
974 { "alAuxiliaryEffectSlotf", wine_alAuxiliaryEffectSlotf
},
975 { "alAuxiliaryEffectSlotfv", wine_alAuxiliaryEffectSlotfv
},
976 { "alAuxiliaryEffectSloti", wine_alAuxiliaryEffectSloti
},
977 { "alAuxiliaryEffectSlotiv", wine_alAuxiliaryEffectSlotiv
},
978 { "alGetAuxiliaryEffectSlotf", wine_alGetAuxiliaryEffectSlotf
},
979 { "alGetAuxiliaryEffectSlotfv", wine_alGetAuxiliaryEffectSlotfv
},
980 { "alGetAuxiliaryEffectSloti", wine_alGetAuxiliaryEffectSloti
},
981 { "alGetAuxiliaryEffectSlotiv", wine_alGetAuxiliaryEffectSlotiv
},
987 ALCvoid
* CDECL
wine_alcGetProcAddress(ALCdevice
*device
, const ALCchar
*funcname
)
992 /* Make sure the host implementation has the requested function */
993 proc
= alcGetProcAddress(device
, funcname
);
997 for(i
= 0;ALCFuncs
[i
].name
;i
++)
999 if(strcmp(funcname
, ALCFuncs
[i
].name
) == 0)
1000 return ALCFuncs
[i
].proc
;
1002 FIXME("Could not find function in list: %s\n", funcname
);
1007 ALvoid
* CDECL
wine_alGetProcAddress(const ALchar
* funcname
)
1012 /* Make sure the host implementation has the requested function. This will
1013 * also set the last AL error properly if the function should not be
1014 * returned (eg. no current context). */
1015 proc
= alGetProcAddress(funcname
);
1019 for(i
= 0;ALFuncs
[i
].name
;i
++)
1021 if(strcmp(funcname
, ALFuncs
[i
].name
) == 0)
1022 return ALFuncs
[i
].proc
;
1024 FIXME("Could not find function in list: %s\n", funcname
);