1 #ifndef ALC_CONTEXT_H_ 2 #define ALC_CONTEXT_H_ 3 4 #include "altypes.h" 5 #include "alctypes.h" 6 7 #ifdef __cplusplus 8 extern "C" { 9 #endif 10 11 #define ALC_VERSION_0_1 1 12 13 #ifdef _WIN32 14 typedef struct ALCdevice_struct ALCdevice; 15 typedef struct ALCcontext_struct ALCcontext; 16 #ifndef _XBOX 17 #ifdef _OPENAL32LIB 18 #define ALCAPI __declspec(dllexport) 19 #else 20 #define ALCAPI __declspec(dllimport) 21 #endif 22 #define ALCAPIENTRY __cdecl 23 #endif 24 #endif 25 26 #ifdef TARGET_OS_MAC 27 #if TARGET_OS_MAC 28 #pragma export on 29 #endif 30 #endif 31 32 #ifndef ALCAPI 33 #define ALCAPI 34 #endif 35 36 #ifndef ALCAPIENTRY 37 #define ALCAPIENTRY 38 #endif 39 40 41 #ifndef ALC_NO_PROTOTYPES 42 43 /* 44 * Context Management 45 */ 46 ALCAPI ALCcontext * ALCAPIENTRY alcCreateContext( ALCdevice *device, const ALCint* attrlist ); 47 48 ALCAPI ALCboolean ALCAPIENTRY alcMakeContextCurrent( ALCcontext *context ); 49 50 ALCAPI void ALCAPIENTRY alcProcessContext( ALCcontext *context ); 51 52 ALCAPI void ALCAPIENTRY alcSuspendContext( ALCcontext *context ); 53 54 ALCAPI void ALCAPIENTRY alcDestroyContext( ALCcontext *context ); 55 56 ALCAPI ALCcontext * ALCAPIENTRY alcGetCurrentContext( ALCvoid ); 57 58 ALCAPI ALCdevice* ALCAPIENTRY alcGetContextsDevice( ALCcontext *context ); 59 60 61 /* 62 * Device Management 63 */ 64 ALCAPI ALCdevice * ALCAPIENTRY alcOpenDevice( const ALchar *devicename ); 65 66 ALCAPI ALCboolean ALCAPIENTRY alcCloseDevice( ALCdevice *device ); 67 68 69 /* 70 * Error support. 71 * Obtain the most recent Context error 72 */ 73 ALCAPI ALCenum ALCAPIENTRY alcGetError( ALCdevice *device ); 74 75 76 /* 77 * Extension support. 78 * Query for the presence of an extension, and obtain any appropriate 79 * function pointers and enum values. 80 */ 81 ALCAPI ALCboolean ALCAPIENTRY alcIsExtensionPresent( ALCdevice *device, const ALCchar *extname ); 82 83 ALCAPI void * ALCAPIENTRY alcGetProcAddress( ALCdevice *device, const ALCchar *funcname ); 84 85 ALCAPI ALCenum ALCAPIENTRY alcGetEnumValue( ALCdevice *device, const ALCchar *enumname ); 86 87 88 /* 89 * Query functions 90 */ 91 ALCAPI const ALCchar * ALCAPIENTRY alcGetString( ALCdevice *device, ALCenum param ); 92 93 ALCAPI void ALCAPIENTRY alcGetIntegerv( ALCdevice *device, ALCenum param, ALCsizei size, ALCint *data ); 94 95 96 /* 97 * Capture functions 98 */ 99 ALCAPI ALCdevice* ALCAPIENTRY alcCaptureOpenDevice( const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize ); 100 101 ALCAPI ALCboolean ALCAPIENTRY alcCaptureCloseDevice( ALCdevice *device ); 102 103 ALCAPI void ALCAPIENTRY alcCaptureStart( ALCdevice *device ); 104 105 ALCAPI void ALCAPIENTRY alcCaptureStop( ALCdevice *device ); 106 107 ALCAPI void ALCAPIENTRY alcCaptureSamples( ALCdevice *device, ALCvoid *buffer, ALCsizei samples ); 108 109 #else /* ALC_NO_PROTOTYPES */ 110 /* 111 ALCAPI ALCcontext * (ALCAPIENTRY *alcCreateContext)( ALCdevice *device, const ALCint* attrlist ); 112 ALCAPI ALCboolean (ALCAPIENTRY *alcMakeContextCurrent)( ALCcontext *context ); 113 ALCAPI void (ALCAPIENTRY *alcProcessContext)( ALCcontext *context ); 114 ALCAPI void (ALCAPIENTRY *alcSuspendContext)( ALCcontext *context ); 115 ALCAPI void (ALCAPIENTRY *alcDestroyContext)( ALCcontext *context ); 116 ALCAPI ALCcontext * (ALCAPIENTRY *alcGetCurrentContext)( ALCvoid ); 117 ALCAPI ALCdevice * (ALCAPIENTRY *alcGetContextsDevice)( ALCcontext *context ); 118 ALCAPI ALCdevice * (ALCAPIENTRY *alcOpenDevice)( const ALCchar *devicename ); 119 ALCAPI ALCboolean (ALCAPIENTRY *alcCloseDevice)( ALCdevice *device ); 120 ALCAPI ALCenum (ALCAPIENTRY *alcGetError)( ALCdevice *device ); 121 ALCAPI ALCboolean (ALCAPIENTRY *alcIsExtensionPresent)( ALCdevice *device, const ALCchar *extname ); 122 ALCAPI void * (ALCAPIENTRY *alcGetProcAddress)( ALCdevice *device, const ALCchar *funcname ); 123 ALCAPI ALCenum (ALCAPIENTRY *alcGetEnumValue)( ALCdevice *device, const ALCchar *enumname ); 124 ALCAPI const ALCchar* (ALCAPIENTRY *alcGetString)( ALCdevice *device, ALCenum param ); 125 ALCAPI void (ALCAPIENTRY *alcGetIntegerv)( ALCdevice *device, ALCenum param, ALCsizei size, ALCint *dest ); 126 ALCAPI ALCdevice * (ALCAPIENTRY *alcCaptureOpenDevice)( const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize ); 127 ALCAPI ALCboolean (ALCAPIENTRY *alcCaptureCloseDevice)( ALCdevice *device ); 128 ALCAPI void (ALCAPIENTRY *alcCaptureStart)( ALCdevice *device ); 129 ALCAPI void (ALCAPIENTRY *alcCaptureStop)( ALCdevice *device ); 130 ALCAPI void (ALCAPIENTRY *alcCaptureSamples)( ALCdevice *device, ALCvoid *buffer, ALCsizei samples ); 131 */ 132 /* Type definitions */ 133 typedef ALCcontext * (ALCAPIENTRY *LPALCCREATECONTEXT) (ALCdevice *device, const ALCint *attrlist); 134 typedef ALCboolean (ALCAPIENTRY *LPALCMAKECONTEXTCURRENT)( ALCcontext *context ); 135 typedef void (ALCAPIENTRY *LPALCPROCESSCONTEXT)( ALCcontext *context ); 136 typedef void (ALCAPIENTRY *LPALCSUSPENDCONTEXT)( ALCcontext *context ); 137 typedef void (ALCAPIENTRY *LPALCDESTROYCONTEXT)( ALCcontext *context ); 138 typedef ALCcontext * (ALCAPIENTRY *LPALCGETCURRENTCONTEXT)( ALCvoid ); 139 typedef ALCdevice * (ALCAPIENTRY *LPALCGETCONTEXTSDEVICE)( ALCcontext *context ); 140 typedef ALCdevice * (ALCAPIENTRY *LPALCOPENDEVICE)( const ALCchar *devicename ); 141 typedef ALCboolean (ALCAPIENTRY *LPALCCLOSEDEVICE)( ALCdevice *device ); 142 typedef ALCenum (ALCAPIENTRY *LPALCGETERROR)( ALCdevice *device ); 143 typedef ALCboolean (ALCAPIENTRY *LPALCISEXTENSIONPRESENT)( ALCdevice *device, const ALCchar *extname ); 144 typedef void * (ALCAPIENTRY *LPALCGETPROCADDRESS)(ALCdevice *device, const ALCchar *funcname ); 145 typedef ALCenum (ALCAPIENTRY *LPALCGETENUMVALUE)(ALCdevice *device, const ALCchar *enumname ); 146 typedef const ALCchar* (ALCAPIENTRY *LPALCGETSTRING)( ALCdevice *device, ALCenum param ); 147 typedef void (ALCAPIENTRY *LPALCGETINTEGERV)( ALCdevice *device, ALCenum param, ALCsizei size, ALCint *dest ); 148 typedef ALCdevice * (ALCAPIENTRY *LPALCCAPTUREOPENDEVICE)( const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize ); 149 typedef ALCboolean (ALCAPIENTRY *LPALCCAPTURECLOSEDEVICE)( ALCdevice *device ); 150 typedef void (ALCAPIENTRY *LPALCCAPTURESTART)( ALCdevice *device ); 151 typedef void (ALCAPIENTRY *LPALCCAPTURESTOP)( ALCdevice *device ); 152 typedef void (ALCAPIENTRY *LPALCCAPTURESAMPLES)( ALCdevice *device, ALCvoid *buffer, ALCsizei samples ); 153 154 #endif /* ALC_NO_PROTOTYPES */ 155 156 #ifdef TARGET_OS_MAC 157 #if TARGET_OS_MAC 158 #pragma export off 159 #endif /* TARGET_OS_MAC */ 160 #endif /* TARGET_OS_MAC */ 161 162 #ifdef __cplusplus 163 } 164 #endif 165 166 #endif /* ALC_CONTEXT_H_ */ 167