Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/mac_osx/src/external/openal/alc.h @ 7797

Last change on this file since 7797 was 7664, checked in by youngk, 14 years ago

Corrected some serious bug in OpenAL Mac and reduced warnings.

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