4 #if defined(__cplusplus)
9 #if defined(AL_LIBTYPE_STATIC)
12 #define ALC_API __declspec(dllimport)
14 #define ALC_API extern
19 #define ALC_APIENTRY __cdecl
25 /* Deprecated macros. */
26 #define ALCAPI ALC_API
27 #define ALCAPIENTRY ALC_APIENTRY
30 /** Supported ALC version? */
31 #define ALC_VERSION_0_1 1
33 /** Opaque device handle */
34 typedef struct ALCdevice ALCdevice
;
35 /** Opaque context handle */
36 typedef struct ALCcontext ALCcontext
;
39 typedef char ALCboolean
;
44 /** signed 8-bit 2's complement integer */
45 typedef signed char ALCbyte
;
47 /** unsigned 8-bit integer */
48 typedef unsigned char ALCubyte
;
50 /** signed 16-bit 2's complement integer */
51 typedef short ALCshort
;
53 /** unsigned 16-bit integer */
54 typedef unsigned short ALCushort
;
56 /** signed 32-bit 2's complement integer */
59 /** unsigned 32-bit integer */
60 typedef unsigned int ALCuint
;
62 /** non-negative 32-bit binary integer size */
65 /** enumerated 32-bit value */
68 /** 32-bit IEEE754 floating-point */
69 typedef float ALCfloat
;
71 /** 64-bit IEEE754 floating-point */
72 typedef double ALCdouble
;
74 /** void type (for opaque pointers only) */
78 /* Enumerant values begin at column 50. No tabs. */
86 /** Context attribute: <int> Hz. */
87 #define ALC_FREQUENCY 0x1007
89 /** Context attribute: <int> Hz. */
90 #define ALC_REFRESH 0x1008
92 /** Context attribute: AL_TRUE or AL_FALSE synchronous context? */
93 #define ALC_SYNC 0x1009
95 /** Context attribute: <int> requested Mono (3D) Sources. */
96 #define ALC_MONO_SOURCES 0x1010
98 /** Context attribute: <int> requested Stereo Sources. */
99 #define ALC_STEREO_SOURCES 0x1011
102 #define ALC_NO_ERROR 0
104 /** Invalid device handle. */
105 #define ALC_INVALID_DEVICE 0xA001
107 /** Invalid context handle. */
108 #define ALC_INVALID_CONTEXT 0xA002
110 /** Invalid enum parameter passed to an ALC call. */
111 #define ALC_INVALID_ENUM 0xA003
113 /** Invalid value parameter passed to an ALC call. */
114 #define ALC_INVALID_VALUE 0xA004
116 /** Out of memory. */
117 #define ALC_OUT_OF_MEMORY 0xA005
120 /** Runtime ALC major version. */
121 #define ALC_MAJOR_VERSION 0x1000
122 /** Runtime ALC minor version. */
123 #define ALC_MINOR_VERSION 0x1001
125 /** Context attribute list size. */
126 #define ALC_ATTRIBUTES_SIZE 0x1002
127 /** Context attribute list properties. */
128 #define ALC_ALL_ATTRIBUTES 0x1003
130 /** String for the default device specifier. */
131 #define ALC_DEFAULT_DEVICE_SPECIFIER 0x1004
133 * String for the given device's specifier.
135 * If device handle is NULL, it is instead a null-char separated list of
136 * strings of known device specifiers (list ends with an empty string).
138 #define ALC_DEVICE_SPECIFIER 0x1005
139 /** String for space-separated list of ALC extensions. */
140 #define ALC_EXTENSIONS 0x1006
143 /** Capture extension */
144 #define ALC_EXT_CAPTURE 1
146 * String for the given capture device's specifier.
148 * If device handle is NULL, it is instead a null-char separated list of
149 * strings of known capture device specifiers (list ends with an empty string).
151 #define ALC_CAPTURE_DEVICE_SPECIFIER 0x310
152 /** String for the default capture device specifier. */
153 #define ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER 0x311
154 /** Number of sample frames available for capture. */
155 #define ALC_CAPTURE_SAMPLES 0x312
158 /** Enumerate All extension */
159 #define ALC_ENUMERATE_ALL_EXT 1
160 /** String for the default extended device specifier. */
161 #define ALC_DEFAULT_ALL_DEVICES_SPECIFIER 0x1012
163 * String for the given extended device's specifier.
165 * If device handle is NULL, it is instead a null-char separated list of
166 * strings of known extended device specifiers (list ends with an empty string).
168 #define ALC_ALL_DEVICES_SPECIFIER 0x1013
171 /* Context management. */
173 /** Create and attach a context to the given device. */
174 ALC_API ALCcontext
* ALC_APIENTRY
alcCreateContext(ALCdevice
*device
, const ALCint
*attrlist
);
176 * Makes the given context the active process-wide context. Passing NULL clears
177 * the active context.
179 ALC_API ALCboolean ALC_APIENTRY
alcMakeContextCurrent(ALCcontext
*context
);
180 /** Resumes processing updates for the given context. */
181 ALC_API
void ALC_APIENTRY
alcProcessContext(ALCcontext
*context
);
182 /** Suspends updates for the given context. */
183 ALC_API
void ALC_APIENTRY
alcSuspendContext(ALCcontext
*context
);
184 /** Remove a context from its device and destroys it. */
185 ALC_API
void ALC_APIENTRY
alcDestroyContext(ALCcontext
*context
);
186 /** Returns the currently active context. */
187 ALC_API ALCcontext
* ALC_APIENTRY
alcGetCurrentContext(void);
188 /** Returns the device that a particular context is attached to. */
189 ALC_API ALCdevice
* ALC_APIENTRY
alcGetContextsDevice(ALCcontext
*context
);
191 /* Device management. */
193 /** Opens the named playback device. */
194 ALC_API ALCdevice
* ALC_APIENTRY
alcOpenDevice(const ALCchar
*devicename
);
195 /** Closes the given playback device. */
196 ALC_API ALCboolean ALC_APIENTRY
alcCloseDevice(ALCdevice
*device
);
200 /** Obtain the most recent Device error. */
201 ALC_API ALCenum ALC_APIENTRY
alcGetError(ALCdevice
*device
);
203 /* Extension support. */
206 * Query for the presence of an extension on the device. Pass a NULL device to
207 * query a device-inspecific extension.
209 ALC_API ALCboolean ALC_APIENTRY
alcIsExtensionPresent(ALCdevice
*device
, const ALCchar
*extname
);
211 * Retrieve the address of a function. Given a non-NULL device, the returned
212 * function may be device-specific.
214 ALC_API ALCvoid
* ALC_APIENTRY
alcGetProcAddress(ALCdevice
*device
, const ALCchar
*funcname
);
216 * Retrieve the value of an enum. Given a non-NULL device, the returned value
217 * may be device-specific.
219 ALC_API ALCenum ALC_APIENTRY
alcGetEnumValue(ALCdevice
*device
, const ALCchar
*enumname
);
221 /* Query functions. */
223 /** Returns information about the device, and error strings. */
224 ALC_API
const ALCchar
* ALC_APIENTRY
alcGetString(ALCdevice
*device
, ALCenum param
);
225 /** Returns information about the device and the version of OpenAL. */
226 ALC_API
void ALC_APIENTRY
alcGetIntegerv(ALCdevice
*device
, ALCenum param
, ALCsizei size
, ALCint
*values
);
228 /* Capture functions. */
231 * Opens the named capture device with the given frequency, format, and buffer
234 ALC_API ALCdevice
* ALC_APIENTRY
alcCaptureOpenDevice(const ALCchar
*devicename
, ALCuint frequency
, ALCenum format
, ALCsizei buffersize
);
235 /** Closes the given capture device. */
236 ALC_API ALCboolean ALC_APIENTRY
alcCaptureCloseDevice(ALCdevice
*device
);
237 /** Starts capturing samples into the device buffer. */
238 ALC_API
void ALC_APIENTRY
alcCaptureStart(ALCdevice
*device
);
239 /** Stops capturing samples. Samples in the device buffer remain available. */
240 ALC_API
void ALC_APIENTRY
alcCaptureStop(ALCdevice
*device
);
241 /** Reads samples from the device buffer. */
242 ALC_API
void ALC_APIENTRY
alcCaptureSamples(ALCdevice
*device
, ALCvoid
*buffer
, ALCsizei samples
);
244 /* Pointer-to-function type, useful for dynamically getting ALC entry points. */
245 typedef ALCcontext
* (ALC_APIENTRY
*LPALCCREATECONTEXT
)(ALCdevice
*device
, const ALCint
*attrlist
);
246 typedef ALCboolean (ALC_APIENTRY
*LPALCMAKECONTEXTCURRENT
)(ALCcontext
*context
);
247 typedef void (ALC_APIENTRY
*LPALCPROCESSCONTEXT
)(ALCcontext
*context
);
248 typedef void (ALC_APIENTRY
*LPALCSUSPENDCONTEXT
)(ALCcontext
*context
);
249 typedef void (ALC_APIENTRY
*LPALCDESTROYCONTEXT
)(ALCcontext
*context
);
250 typedef ALCcontext
* (ALC_APIENTRY
*LPALCGETCURRENTCONTEXT
)(void);
251 typedef ALCdevice
* (ALC_APIENTRY
*LPALCGETCONTEXTSDEVICE
)(ALCcontext
*context
);
252 typedef ALCdevice
* (ALC_APIENTRY
*LPALCOPENDEVICE
)(const ALCchar
*devicename
);
253 typedef ALCboolean (ALC_APIENTRY
*LPALCCLOSEDEVICE
)(ALCdevice
*device
);
254 typedef ALCenum (ALC_APIENTRY
*LPALCGETERROR
)(ALCdevice
*device
);
255 typedef ALCboolean (ALC_APIENTRY
*LPALCISEXTENSIONPRESENT
)(ALCdevice
*device
, const ALCchar
*extname
);
256 typedef ALCvoid
* (ALC_APIENTRY
*LPALCGETPROCADDRESS
)(ALCdevice
*device
, const ALCchar
*funcname
);
257 typedef ALCenum (ALC_APIENTRY
*LPALCGETENUMVALUE
)(ALCdevice
*device
, const ALCchar
*enumname
);
258 typedef const ALCchar
* (ALC_APIENTRY
*LPALCGETSTRING
)(ALCdevice
*device
, ALCenum param
);
259 typedef void (ALC_APIENTRY
*LPALCGETINTEGERV
)(ALCdevice
*device
, ALCenum param
, ALCsizei size
, ALCint
*values
);
260 typedef ALCdevice
* (ALC_APIENTRY
*LPALCCAPTUREOPENDEVICE
)(const ALCchar
*devicename
, ALCuint frequency
, ALCenum format
, ALCsizei buffersize
);
261 typedef ALCboolean (ALC_APIENTRY
*LPALCCAPTURECLOSEDEVICE
)(ALCdevice
*device
);
262 typedef void (ALC_APIENTRY
*LPALCCAPTURESTART
)(ALCdevice
*device
);
263 typedef void (ALC_APIENTRY
*LPALCCAPTURESTOP
)(ALCdevice
*device
);
264 typedef void (ALC_APIENTRY
*LPALCCAPTURESAMPLES
)(ALCdevice
*device
, ALCvoid
*buffer
, ALCsizei samples
);
266 #if defined(__cplusplus)
270 #endif /* AL_ALC_H */