X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Dependencies%2FOpenAL%2Finclude%2FAL%2Falc.h;h=4e84af422313e63125930d3952bcd8faa9306b37;hb=2e4c2fd2e05bc8c910b614f45cbbf903d158658c;hp=5c8831f763030ec8bc21ab0ddc676189b3fc95b8;hpb=92a35e3a42a685fd18931e255c899b493a9a6dee;p=lugaru.git diff --git a/Dependencies/OpenAL/include/AL/alc.h b/Dependencies/OpenAL/include/AL/alc.h index 5c8831f..4e84af4 100644 --- a/Dependencies/OpenAL/include/AL/alc.h +++ b/Dependencies/OpenAL/include/AL/alc.h @@ -1,110 +1,275 @@ -#ifndef ALC_CONTEXT_H_ -#define ALC_CONTEXT_H_ +#ifndef AL_ALC_H +#define AL_ALC_H -#include "altypes.h" -#include "alctypes.h" - -#ifdef __cplusplus +#if defined(__cplusplus) extern "C" { #endif -#define ALC_VERSION_0_1 1 - -#ifdef _WIN32 - #ifdef _OPENAL32LIB - #define ALCAPI __declspec(dllexport) +#if defined(_WIN32) && !defined(_XBOX) + #if defined(AL_BUILD_LIBRARY) + #define ALC_API __declspec(dllexport) #else - #define ALCAPI __declspec(dllimport) + #define ALC_API __declspec(dllimport) #endif - - typedef struct ALCdevice_struct ALCdevice; - typedef struct ALCcontext_struct ALCcontext; - - #define ALCAPIENTRY __cdecl #else - #ifdef TARGET_OS_MAC - #if TARGET_OS_MAC - #pragma export on - #endif + #if defined(AL_BUILD_LIBRARY) && defined(HAVE_GCC_VISIBILITY) + #define ALC_API __attribute__((visibility("protected"))) + #else + #define ALC_API extern #endif +#endif + +#if defined(_WIN32) + #define ALC_APIENTRY __cdecl +#else + #define ALC_APIENTRY +#endif - #define ALCAPI - #define ALCAPIENTRY +#if defined(TARGET_OS_MAC) && TARGET_OS_MAC + #pragma export on #endif -#ifndef AL_NO_PROTOTYPES +/* + * The ALCAPI, ALCAPIENTRY, and ALC_INVALID macros are deprecated, but are + * included for applications porting code from AL 1.0 + */ +#define ALCAPI ALC_API +#define ALCAPIENTRY ALC_APIENTRY +#define ALC_INVALID 0 + + +#define ALC_VERSION_0_1 1 + +typedef struct ALCdevice_struct ALCdevice; +typedef struct ALCcontext_struct ALCcontext; + + +/** 8-bit boolean */ +typedef char ALCboolean; + +/** character */ +typedef char ALCchar; + +/** signed 8-bit 2's complement integer */ +typedef signed char ALCbyte; + +/** unsigned 8-bit integer */ +typedef unsigned char ALCubyte; + +/** signed 16-bit 2's complement integer */ +typedef short ALCshort; + +/** unsigned 16-bit integer */ +typedef unsigned short ALCushort; + +/** signed 32-bit 2's complement integer */ +typedef int ALCint; + +/** unsigned 32-bit integer */ +typedef unsigned int ALCuint; + +/** non-negative 32-bit binary integer size */ +typedef int ALCsizei; + +/** enumerated 32-bit value */ +typedef int ALCenum; + +/** 32-bit IEEE754 floating-point */ +typedef float ALCfloat; + +/** 64-bit IEEE754 floating-point */ +typedef double ALCdouble; + +/** void type (for opaque pointers only) */ +typedef void ALCvoid; + + +/* Enumerant values begin at column 50. No tabs. */ + +/* Boolean False. */ +#define ALC_FALSE 0 + +/* Boolean True. */ +#define ALC_TRUE 1 + +/** + * followed by Hz + */ +#define ALC_FREQUENCY 0x1007 + +/** + * followed by Hz + */ +#define ALC_REFRESH 0x1008 + +/** + * followed by AL_TRUE, AL_FALSE + */ +#define ALC_SYNC 0x1009 + +/** + * followed by Num of requested Mono (3D) Sources + */ +#define ALC_MONO_SOURCES 0x1010 + +/** + * followed by Num of requested Stereo Sources + */ +#define ALC_STEREO_SOURCES 0x1011 + +/** + * errors + */ -ALCAPI ALCcontext * ALCAPIENTRY alcCreateContext( ALCdevice *dev, - ALint* attrlist ); +/** + * No error + */ +#define ALC_NO_ERROR ALC_FALSE /** - * There is no current context, as we can mix - * several active contexts. But al* calls - * only affect the current context. + * No device */ -ALCAPI ALCenum ALCAPIENTRY alcMakeContextCurrent( ALCcontext *alcHandle ); +#define ALC_INVALID_DEVICE 0xA001 /** - * Perform processing on a synced context, non-op on a asynchronous - * context. + * invalid context ID */ -ALCAPI ALCcontext * ALCAPIENTRY alcProcessContext( ALCcontext *alcHandle ); +#define ALC_INVALID_CONTEXT 0xA002 /** - * Suspend processing on an asynchronous context, non-op on a - * synced context. + * bad enum */ -ALCAPI void ALCAPIENTRY alcSuspendContext( ALCcontext *alcHandle ); +#define ALC_INVALID_ENUM 0xA003 -ALCAPI ALCenum ALCAPIENTRY alcDestroyContext( ALCcontext *alcHandle ); +/** + * bad value + */ +#define ALC_INVALID_VALUE 0xA004 -ALCAPI ALCenum ALCAPIENTRY alcGetError( ALCdevice *dev ); +/** + * Out of memory. + */ +#define ALC_OUT_OF_MEMORY 0xA005 -ALCAPI ALCcontext * ALCAPIENTRY alcGetCurrentContext( ALvoid ); -ALCAPI ALCdevice *alcOpenDevice( const ALubyte *tokstr ); -ALCAPI void alcCloseDevice( ALCdevice *dev ); +/** + * The Specifier string for default device + */ +#define ALC_DEFAULT_DEVICE_SPECIFIER 0x1004 +#define ALC_DEVICE_SPECIFIER 0x1005 +#define ALC_EXTENSIONS 0x1006 -ALCAPI ALboolean ALCAPIENTRY alcIsExtensionPresent(ALCdevice *device, ALubyte *extName); -ALCAPI ALvoid * ALCAPIENTRY alcGetProcAddress(ALCdevice *device, ALubyte *funcName); -ALCAPI ALenum ALCAPIENTRY alcGetEnumValue(ALCdevice *device, ALubyte *enumName); +#define ALC_MAJOR_VERSION 0x1000 +#define ALC_MINOR_VERSION 0x1001 -ALCAPI ALCdevice* ALCAPIENTRY alcGetContextsDevice(ALCcontext *context); +#define ALC_ATTRIBUTES_SIZE 0x1002 +#define ALC_ALL_ATTRIBUTES 0x1003 /** + * Capture extension + */ +#define ALC_CAPTURE_DEVICE_SPECIFIER 0x310 +#define ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER 0x311 +#define ALC_CAPTURE_SAMPLES 0x312 + + +/* + * Context Management + */ +ALC_API ALCcontext * ALC_APIENTRY alcCreateContext( ALCdevice *device, const ALCint* attrlist ); + +ALC_API ALCboolean ALC_APIENTRY alcMakeContextCurrent( ALCcontext *context ); + +ALC_API void ALC_APIENTRY alcProcessContext( ALCcontext *context ); + +ALC_API void ALC_APIENTRY alcSuspendContext( ALCcontext *context ); + +ALC_API void ALC_APIENTRY alcDestroyContext( ALCcontext *context ); + +ALC_API ALCcontext * ALC_APIENTRY alcGetCurrentContext( void ); + +ALC_API ALCdevice* ALC_APIENTRY alcGetContextsDevice( ALCcontext *context ); + + +/* + * Device Management + */ +ALC_API ALCdevice * ALC_APIENTRY alcOpenDevice( const ALCchar *devicename ); + +ALC_API ALCboolean ALC_APIENTRY alcCloseDevice( ALCdevice *device ); + + +/* + * Error support. + * Obtain the most recent Context error + */ +ALC_API ALCenum ALC_APIENTRY alcGetError( ALCdevice *device ); + + +/* + * Extension support. + * Query for the presence of an extension, and obtain any appropriate + * function pointers and enum values. + */ +ALC_API ALCboolean ALC_APIENTRY alcIsExtensionPresent( ALCdevice *device, const ALCchar *extname ); + +ALC_API void * ALC_APIENTRY alcGetProcAddress( ALCdevice *device, const ALCchar *funcname ); + +ALC_API ALCenum ALC_APIENTRY alcGetEnumValue( ALCdevice *device, const ALCchar *enumname ); + + +/* * Query functions */ -const ALubyte * alcGetString( ALCdevice *deviceHandle, ALenum token ); -void alcGetIntegerv( ALCdevice *deviceHandle, ALenum token , ALsizei size , ALint *dest ); +ALC_API const ALCchar * ALC_APIENTRY alcGetString( ALCdevice *device, ALCenum param ); -#else - ALCcontext * (*alcCreateContext)( ALCdevice *dev, ALint* attrlist ); - ALCenum (*alcMakeContextCurrent)( ALCcontext *alcHandle ); - ALCcontext * (*alcProcessContext)( ALCcontext *alcHandle ); - void (*alcSuspendContext)( ALCcontext *alcHandle ); - ALCenum (*alcDestroyContext)( ALCcontext *alcHandle ); - ALCenum (*alcGetError)( ALCdevice *dev ); - ALCcontext * (*alcGetCurrentContext)( ALvoid ); - ALCdevice * (*alcOpenDevice)( const ALubyte *tokstr ); - void (*alcCloseDevice)( ALCdevice *dev ); - ALboolean (*alcIsExtensionPresent)( ALCdevice *device, ALubyte *extName ); - ALvoid * (*alcGetProcAddress)(ALCdevice *device, ALubyte *funcName ); - ALenum (*alcGetEnumValue)(ALCdevice *device, ALubyte *enumName); - ALCdevice* (*alcGetContextsDevice)(ALCcontext *context); - const ALubyte* (*alcGetString)( ALCdevice *deviceHandle, ALenum token ); - void (*alcGetIntegerv*)( ALCdevice *deviceHandle, ALenum token , ALsizei size , ALint *dest ); - -#endif /* AL_NO_PROTOTYPES */ - -#ifdef TARGET_OS_MAC -#if TARGET_OS_MAC -#pragma export off -#endif /* TARGET_OS_MAC */ -#endif /* TARGET_OS_MAC */ - -#ifdef __cplusplus +ALC_API void ALC_APIENTRY alcGetIntegerv( ALCdevice *device, ALCenum param, ALCsizei size, ALCint *data ); + + +/* + * Capture functions + */ +ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice( const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize ); + +ALC_API ALCboolean ALC_APIENTRY alcCaptureCloseDevice( ALCdevice *device ); + +ALC_API void ALC_APIENTRY alcCaptureStart( ALCdevice *device ); + +ALC_API void ALC_APIENTRY alcCaptureStop( ALCdevice *device ); + +ALC_API void ALC_APIENTRY alcCaptureSamples( ALCdevice *device, ALCvoid *buffer, ALCsizei samples ); + +/* + * Pointer-to-function types, useful for dynamically getting ALC entry points. + */ +typedef ALCcontext * (ALC_APIENTRY *LPALCCREATECONTEXT) (ALCdevice *device, const ALCint *attrlist); +typedef ALCboolean (ALC_APIENTRY *LPALCMAKECONTEXTCURRENT)( ALCcontext *context ); +typedef void (ALC_APIENTRY *LPALCPROCESSCONTEXT)( ALCcontext *context ); +typedef void (ALC_APIENTRY *LPALCSUSPENDCONTEXT)( ALCcontext *context ); +typedef void (ALC_APIENTRY *LPALCDESTROYCONTEXT)( ALCcontext *context ); +typedef ALCcontext * (ALC_APIENTRY *LPALCGETCURRENTCONTEXT)( void ); +typedef ALCdevice * (ALC_APIENTRY *LPALCGETCONTEXTSDEVICE)( ALCcontext *context ); +typedef ALCdevice * (ALC_APIENTRY *LPALCOPENDEVICE)( const ALCchar *devicename ); +typedef ALCboolean (ALC_APIENTRY *LPALCCLOSEDEVICE)( ALCdevice *device ); +typedef ALCenum (ALC_APIENTRY *LPALCGETERROR)( ALCdevice *device ); +typedef ALCboolean (ALC_APIENTRY *LPALCISEXTENSIONPRESENT)( ALCdevice *device, const ALCchar *extname ); +typedef void * (ALC_APIENTRY *LPALCGETPROCADDRESS)(ALCdevice *device, const ALCchar *funcname ); +typedef ALCenum (ALC_APIENTRY *LPALCGETENUMVALUE)(ALCdevice *device, const ALCchar *enumname ); +typedef const ALCchar* (ALC_APIENTRY *LPALCGETSTRING)( ALCdevice *device, ALCenum param ); +typedef void (ALC_APIENTRY *LPALCGETINTEGERV)( ALCdevice *device, ALCenum param, ALCsizei size, ALCint *dest ); +typedef ALCdevice * (ALC_APIENTRY *LPALCCAPTUREOPENDEVICE)( const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize ); +typedef ALCboolean (ALC_APIENTRY *LPALCCAPTURECLOSEDEVICE)( ALCdevice *device ); +typedef void (ALC_APIENTRY *LPALCCAPTURESTART)( ALCdevice *device ); +typedef void (ALC_APIENTRY *LPALCCAPTURESTOP)( ALCdevice *device ); +typedef void (ALC_APIENTRY *LPALCCAPTURESAMPLES)( ALCdevice *device, ALCvoid *buffer, ALCsizei samples ); + +#if defined(TARGET_OS_MAC) && TARGET_OS_MAC + #pragma export off +#endif + +#if defined(__cplusplus) } #endif -#endif /* ALC_CONTEXT_H_ */ +#endif /* AL_ALC_H */