]> git.jsancho.org Git - lugaru.git/blob - Dependencies/OpenAL/include/AL/alc.h
CMake: Fix linking against system OpenAL via pkgconfig
[lugaru.git] / Dependencies / OpenAL / include / AL / alc.h
1 #ifndef AL_ALC_H
2 #define AL_ALC_H
3
4 #if defined(__cplusplus)
5 extern "C" {
6 #endif
7
8 #if defined(_WIN32) && !defined(_XBOX)
9  #if defined(AL_BUILD_LIBRARY)
10   #define ALC_API __declspec(dllexport)
11  #else
12   #define ALC_API __declspec(dllimport)
13  #endif
14 #else
15  #if defined(AL_BUILD_LIBRARY) && defined(HAVE_GCC_VISIBILITY)
16   #define ALC_API __attribute__((visibility("protected")))
17  #else
18   #define ALC_API extern
19  #endif
20 #endif
21
22 #if defined(_WIN32)
23  #define ALC_APIENTRY __cdecl
24 #else
25  #define ALC_APIENTRY
26 #endif
27
28 #if defined(TARGET_OS_MAC) && TARGET_OS_MAC
29  #pragma export on
30 #endif
31
32 /*
33  * The ALCAPI, ALCAPIENTRY, and ALC_INVALID macros are deprecated, but are
34  * included for applications porting code from AL 1.0
35  */
36 #define ALCAPI ALC_API
37 #define ALCAPIENTRY ALC_APIENTRY
38 #define ALC_INVALID 0
39
40
41 #define ALC_VERSION_0_1         1
42
43 typedef struct ALCdevice_struct ALCdevice;
44 typedef struct ALCcontext_struct ALCcontext;
45
46
47 /** 8-bit boolean */
48 typedef char ALCboolean;
49
50 /** character */
51 typedef char ALCchar;
52
53 /** signed 8-bit 2's complement integer */
54 typedef signed char ALCbyte;
55
56 /** unsigned 8-bit integer */
57 typedef unsigned char ALCubyte;
58
59 /** signed 16-bit 2's complement integer */
60 typedef short ALCshort;
61
62 /** unsigned 16-bit integer */
63 typedef unsigned short ALCushort;
64
65 /** signed 32-bit 2's complement integer */
66 typedef int ALCint;
67
68 /** unsigned 32-bit integer */
69 typedef unsigned int ALCuint;
70
71 /** non-negative 32-bit binary integer size */
72 typedef int ALCsizei;
73
74 /** enumerated 32-bit value */
75 typedef int ALCenum;
76
77 /** 32-bit IEEE754 floating-point */
78 typedef float ALCfloat;
79
80 /** 64-bit IEEE754 floating-point */
81 typedef double ALCdouble;
82
83 /** void type (for opaque pointers only) */
84 typedef void ALCvoid;
85
86
87 /* Enumerant values begin at column 50. No tabs. */
88
89 /* Boolean False. */
90 #define ALC_FALSE                                0
91
92 /* Boolean True. */
93 #define ALC_TRUE                                 1
94
95 /**
96  * followed by <int> Hz
97  */
98 #define ALC_FREQUENCY                            0x1007
99
100 /**
101  * followed by <int> Hz
102  */
103 #define ALC_REFRESH                              0x1008
104
105 /**
106  * followed by AL_TRUE, AL_FALSE
107  */
108 #define ALC_SYNC                                 0x1009
109
110 /**
111  * followed by <int> Num of requested Mono (3D) Sources
112  */
113 #define ALC_MONO_SOURCES                         0x1010
114
115 /**
116  * followed by <int> Num of requested Stereo Sources
117  */
118 #define ALC_STEREO_SOURCES                       0x1011
119
120 /**
121  * errors
122  */
123
124 /**
125  * No error
126  */
127 #define ALC_NO_ERROR                             ALC_FALSE
128
129 /**
130  * No device
131  */
132 #define ALC_INVALID_DEVICE                       0xA001
133
134 /**
135  * invalid context ID
136  */
137 #define ALC_INVALID_CONTEXT                      0xA002
138
139 /**
140  * bad enum
141  */
142 #define ALC_INVALID_ENUM                         0xA003
143
144 /**
145  * bad value
146  */
147 #define ALC_INVALID_VALUE                        0xA004
148
149 /**
150  * Out of memory.
151  */
152 #define ALC_OUT_OF_MEMORY                        0xA005
153
154
155 /**
156  * The Specifier string for default device
157  */
158 #define ALC_DEFAULT_DEVICE_SPECIFIER             0x1004
159 #define ALC_DEVICE_SPECIFIER                     0x1005
160 #define ALC_EXTENSIONS                           0x1006
161
162 #define ALC_MAJOR_VERSION                        0x1000
163 #define ALC_MINOR_VERSION                        0x1001
164
165 #define ALC_ATTRIBUTES_SIZE                      0x1002
166 #define ALC_ALL_ATTRIBUTES                       0x1003
167
168
169 /**
170  * Capture extension
171  */
172 #define ALC_CAPTURE_DEVICE_SPECIFIER             0x310
173 #define ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER     0x311
174 #define ALC_CAPTURE_SAMPLES                      0x312
175
176
177 /*
178  * Context Management
179  */
180 ALC_API ALCcontext *    ALC_APIENTRY alcCreateContext( ALCdevice *device, const ALCint* attrlist );
181
182 ALC_API ALCboolean      ALC_APIENTRY alcMakeContextCurrent( ALCcontext *context );
183
184 ALC_API void            ALC_APIENTRY alcProcessContext( ALCcontext *context );
185
186 ALC_API void            ALC_APIENTRY alcSuspendContext( ALCcontext *context );
187
188 ALC_API void            ALC_APIENTRY alcDestroyContext( ALCcontext *context );
189
190 ALC_API ALCcontext *    ALC_APIENTRY alcGetCurrentContext( void );
191
192 ALC_API ALCdevice*      ALC_APIENTRY alcGetContextsDevice( ALCcontext *context );
193
194
195 /*
196  * Device Management
197  */
198 ALC_API ALCdevice *     ALC_APIENTRY alcOpenDevice( const ALCchar *devicename );
199
200 ALC_API ALCboolean      ALC_APIENTRY alcCloseDevice( ALCdevice *device );
201
202
203 /*
204  * Error support.
205  * Obtain the most recent Context error
206  */
207 ALC_API ALCenum         ALC_APIENTRY alcGetError( ALCdevice *device );
208
209
210 /* 
211  * Extension support.
212  * Query for the presence of an extension, and obtain any appropriate
213  * function pointers and enum values.
214  */
215 ALC_API ALCboolean      ALC_APIENTRY alcIsExtensionPresent( ALCdevice *device, const ALCchar *extname );
216
217 ALC_API void  *         ALC_APIENTRY alcGetProcAddress( ALCdevice *device, const ALCchar *funcname );
218
219 ALC_API ALCenum         ALC_APIENTRY alcGetEnumValue( ALCdevice *device, const ALCchar *enumname );
220
221
222 /*
223  * Query functions
224  */
225 ALC_API const ALCchar * ALC_APIENTRY alcGetString( ALCdevice *device, ALCenum param );
226
227 ALC_API void            ALC_APIENTRY alcGetIntegerv( ALCdevice *device, ALCenum param, ALCsizei size, ALCint *data );
228
229
230 /*
231  * Capture functions
232  */
233 ALC_API ALCdevice*      ALC_APIENTRY alcCaptureOpenDevice( const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize );
234
235 ALC_API ALCboolean      ALC_APIENTRY alcCaptureCloseDevice( ALCdevice *device );
236
237 ALC_API void            ALC_APIENTRY alcCaptureStart( ALCdevice *device );
238
239 ALC_API void            ALC_APIENTRY alcCaptureStop( ALCdevice *device );
240
241 ALC_API void            ALC_APIENTRY alcCaptureSamples( ALCdevice *device, ALCvoid *buffer, ALCsizei samples );
242
243 /*
244  * Pointer-to-function types, useful for dynamically getting ALC entry points.
245  */
246 typedef ALCcontext *   (ALC_APIENTRY *LPALCCREATECONTEXT) (ALCdevice *device, const ALCint *attrlist);
247 typedef ALCboolean     (ALC_APIENTRY *LPALCMAKECONTEXTCURRENT)( ALCcontext *context );
248 typedef void           (ALC_APIENTRY *LPALCPROCESSCONTEXT)( ALCcontext *context );
249 typedef void           (ALC_APIENTRY *LPALCSUSPENDCONTEXT)( ALCcontext *context );
250 typedef void           (ALC_APIENTRY *LPALCDESTROYCONTEXT)( ALCcontext *context );
251 typedef ALCcontext *   (ALC_APIENTRY *LPALCGETCURRENTCONTEXT)( void );
252 typedef ALCdevice *    (ALC_APIENTRY *LPALCGETCONTEXTSDEVICE)( ALCcontext *context );
253 typedef ALCdevice *    (ALC_APIENTRY *LPALCOPENDEVICE)( const ALCchar *devicename );
254 typedef ALCboolean     (ALC_APIENTRY *LPALCCLOSEDEVICE)( ALCdevice *device );
255 typedef ALCenum        (ALC_APIENTRY *LPALCGETERROR)( ALCdevice *device );
256 typedef ALCboolean     (ALC_APIENTRY *LPALCISEXTENSIONPRESENT)( ALCdevice *device, const ALCchar *extname );
257 typedef void *         (ALC_APIENTRY *LPALCGETPROCADDRESS)(ALCdevice *device, const ALCchar *funcname );
258 typedef ALCenum        (ALC_APIENTRY *LPALCGETENUMVALUE)(ALCdevice *device, const ALCchar *enumname );
259 typedef const ALCchar* (ALC_APIENTRY *LPALCGETSTRING)( ALCdevice *device, ALCenum param );
260 typedef void           (ALC_APIENTRY *LPALCGETINTEGERV)( ALCdevice *device, ALCenum param, ALCsizei size, ALCint *dest );
261 typedef ALCdevice *    (ALC_APIENTRY *LPALCCAPTUREOPENDEVICE)( const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize );
262 typedef ALCboolean     (ALC_APIENTRY *LPALCCAPTURECLOSEDEVICE)( ALCdevice *device );
263 typedef void           (ALC_APIENTRY *LPALCCAPTURESTART)( ALCdevice *device );
264 typedef void           (ALC_APIENTRY *LPALCCAPTURESTOP)( ALCdevice *device );
265 typedef void           (ALC_APIENTRY *LPALCCAPTURESAMPLES)( ALCdevice *device, ALCvoid *buffer, ALCsizei samples );
266
267 #if defined(TARGET_OS_MAC) && TARGET_OS_MAC
268  #pragma export off
269 #endif
270
271 #if defined(__cplusplus)
272 }
273 #endif
274
275 #endif /* AL_ALC_H */