🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

237 lines
8.4 KiB

  1. #ifndef AL_ALC_H
  2. #define AL_ALC_H
  3. #if defined(__cplusplus)
  4. extern "C" {
  5. #endif
  6. #ifndef ALC_API
  7. #if defined(AL_LIBTYPE_STATIC)
  8. #define ALC_API
  9. #elif defined(_WIN32)
  10. #define ALC_API __declspec(dllimport)
  11. #else
  12. #define ALC_API extern
  13. #endif
  14. #endif
  15. #if defined(_WIN32)
  16. #define ALC_APIENTRY __cdecl
  17. #else
  18. #define ALC_APIENTRY
  19. #endif
  20. /** Deprecated macro. */
  21. #define ALCAPI ALC_API
  22. #define ALCAPIENTRY ALC_APIENTRY
  23. #define ALC_INVALID 0
  24. /** Supported ALC version? */
  25. #define ALC_VERSION_0_1 1
  26. /** Opaque device handle */
  27. typedef struct ALCdevice ALCdevice;
  28. /** Opaque context handle */
  29. typedef struct ALCcontext ALCcontext;
  30. /** 8-bit boolean */
  31. typedef char ALCboolean;
  32. /** character */
  33. typedef char ALCchar;
  34. /** signed 8-bit 2's complement integer */
  35. typedef signed char ALCbyte;
  36. /** unsigned 8-bit integer */
  37. typedef unsigned char ALCubyte;
  38. /** signed 16-bit 2's complement integer */
  39. typedef short ALCshort;
  40. /** unsigned 16-bit integer */
  41. typedef unsigned short ALCushort;
  42. /** signed 32-bit 2's complement integer */
  43. typedef int ALCint;
  44. /** unsigned 32-bit integer */
  45. typedef unsigned int ALCuint;
  46. /** non-negative 32-bit binary integer size */
  47. typedef int ALCsizei;
  48. /** enumerated 32-bit value */
  49. typedef int ALCenum;
  50. /** 32-bit IEEE754 floating-point */
  51. typedef float ALCfloat;
  52. /** 64-bit IEEE754 floating-point */
  53. typedef double ALCdouble;
  54. /** void type (for opaque pointers only) */
  55. typedef void ALCvoid;
  56. /* Enumerant values begin at column 50. No tabs. */
  57. /** Boolean False. */
  58. #define ALC_FALSE 0
  59. /** Boolean True. */
  60. #define ALC_TRUE 1
  61. /** Context attribute: <int> Hz. */
  62. #define ALC_FREQUENCY 0x1007
  63. /** Context attribute: <int> Hz. */
  64. #define ALC_REFRESH 0x1008
  65. /** Context attribute: AL_TRUE or AL_FALSE. */
  66. #define ALC_SYNC 0x1009
  67. /** Context attribute: <int> requested Mono (3D) Sources. */
  68. #define ALC_MONO_SOURCES 0x1010
  69. /** Context attribute: <int> requested Stereo Sources. */
  70. #define ALC_STEREO_SOURCES 0x1011
  71. /** No error. */
  72. #define ALC_NO_ERROR 0
  73. /** Invalid device handle. */
  74. #define ALC_INVALID_DEVICE 0xA001
  75. /** Invalid context handle. */
  76. #define ALC_INVALID_CONTEXT 0xA002
  77. /** Invalid enum parameter passed to an ALC call. */
  78. #define ALC_INVALID_ENUM 0xA003
  79. /** Invalid value parameter passed to an ALC call. */
  80. #define ALC_INVALID_VALUE 0xA004
  81. /** Out of memory. */
  82. #define ALC_OUT_OF_MEMORY 0xA005
  83. /** Runtime ALC version. */
  84. #define ALC_MAJOR_VERSION 0x1000
  85. #define ALC_MINOR_VERSION 0x1001
  86. /** Context attribute list properties. */
  87. #define ALC_ATTRIBUTES_SIZE 0x1002
  88. #define ALC_ALL_ATTRIBUTES 0x1003
  89. /** String for the default device specifier. */
  90. #define ALC_DEFAULT_DEVICE_SPECIFIER 0x1004
  91. /**
  92. * String for the given device's specifier.
  93. *
  94. * If device handle is NULL, it is instead a null-char separated list of
  95. * strings of known device specifiers (list ends with an empty string).
  96. */
  97. #define ALC_DEVICE_SPECIFIER 0x1005
  98. /** String for space-separated list of ALC extensions. */
  99. #define ALC_EXTENSIONS 0x1006
  100. /** Capture extension */
  101. #define ALC_EXT_CAPTURE 1
  102. /**
  103. * String for the given capture device's specifier.
  104. *
  105. * If device handle is NULL, it is instead a null-char separated list of
  106. * strings of known capture device specifiers (list ends with an empty string).
  107. */
  108. #define ALC_CAPTURE_DEVICE_SPECIFIER 0x310
  109. /** String for the default capture device specifier. */
  110. #define ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER 0x311
  111. /** Number of sample frames available for capture. */
  112. #define ALC_CAPTURE_SAMPLES 0x312
  113. /** Enumerate All extension */
  114. #define ALC_ENUMERATE_ALL_EXT 1
  115. /** String for the default extended device specifier. */
  116. #define ALC_DEFAULT_ALL_DEVICES_SPECIFIER 0x1012
  117. /**
  118. * String for the given extended device's specifier.
  119. *
  120. * If device handle is NULL, it is instead a null-char separated list of
  121. * strings of known extended device specifiers (list ends with an empty string).
  122. */
  123. #define ALC_ALL_DEVICES_SPECIFIER 0x1013
  124. /** Context management. */
  125. ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCint* attrlist);
  126. ALC_API ALCboolean ALC_APIENTRY alcMakeContextCurrent(ALCcontext *context);
  127. ALC_API void ALC_APIENTRY alcProcessContext(ALCcontext *context);
  128. ALC_API void ALC_APIENTRY alcSuspendContext(ALCcontext *context);
  129. ALC_API void ALC_APIENTRY alcDestroyContext(ALCcontext *context);
  130. ALC_API ALCcontext* ALC_APIENTRY alcGetCurrentContext(void);
  131. ALC_API ALCdevice* ALC_APIENTRY alcGetContextsDevice(ALCcontext *context);
  132. /** Device management. */
  133. ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *devicename);
  134. ALC_API ALCboolean ALC_APIENTRY alcCloseDevice(ALCdevice *device);
  135. /**
  136. * Error support.
  137. *
  138. * Obtain the most recent Device error.
  139. */
  140. ALC_API ALCenum ALC_APIENTRY alcGetError(ALCdevice *device);
  141. /**
  142. * Extension support.
  143. *
  144. * Query for the presence of an extension, and obtain any appropriate
  145. * function pointers and enum values.
  146. */
  147. ALC_API ALCboolean ALC_APIENTRY alcIsExtensionPresent(ALCdevice *device, const ALCchar *extname);
  148. ALC_API void* ALC_APIENTRY alcGetProcAddress(ALCdevice *device, const ALCchar *funcname);
  149. ALC_API ALCenum ALC_APIENTRY alcGetEnumValue(ALCdevice *device, const ALCchar *enumname);
  150. /** Query function. */
  151. ALC_API const ALCchar* ALC_APIENTRY alcGetString(ALCdevice *device, ALCenum param);
  152. ALC_API void ALC_APIENTRY alcGetIntegerv(ALCdevice *device, ALCenum param, ALCsizei size, ALCint *values);
  153. /** Capture function. */
  154. ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize);
  155. ALC_API ALCboolean ALC_APIENTRY alcCaptureCloseDevice(ALCdevice *device);
  156. ALC_API void ALC_APIENTRY alcCaptureStart(ALCdevice *device);
  157. ALC_API void ALC_APIENTRY alcCaptureStop(ALCdevice *device);
  158. ALC_API void ALC_APIENTRY alcCaptureSamples(ALCdevice *device, ALCvoid *buffer, ALCsizei samples);
  159. /** Pointer-to-function type, useful for dynamically getting ALC entry points. */
  160. typedef ALCcontext* (ALC_APIENTRY *LPALCCREATECONTEXT)(ALCdevice *device, const ALCint *attrlist);
  161. typedef ALCboolean (ALC_APIENTRY *LPALCMAKECONTEXTCURRENT)(ALCcontext *context);
  162. typedef void (ALC_APIENTRY *LPALCPROCESSCONTEXT)(ALCcontext *context);
  163. typedef void (ALC_APIENTRY *LPALCSUSPENDCONTEXT)(ALCcontext *context);
  164. typedef void (ALC_APIENTRY *LPALCDESTROYCONTEXT)(ALCcontext *context);
  165. typedef ALCcontext* (ALC_APIENTRY *LPALCGETCURRENTCONTEXT)(void);
  166. typedef ALCdevice* (ALC_APIENTRY *LPALCGETCONTEXTSDEVICE)(ALCcontext *context);
  167. typedef ALCdevice* (ALC_APIENTRY *LPALCOPENDEVICE)(const ALCchar *devicename);
  168. typedef ALCboolean (ALC_APIENTRY *LPALCCLOSEDEVICE)(ALCdevice *device);
  169. typedef ALCenum (ALC_APIENTRY *LPALCGETERROR)(ALCdevice *device);
  170. typedef ALCboolean (ALC_APIENTRY *LPALCISEXTENSIONPRESENT)(ALCdevice *device, const ALCchar *extname);
  171. typedef void* (ALC_APIENTRY *LPALCGETPROCADDRESS)(ALCdevice *device, const ALCchar *funcname);
  172. typedef ALCenum (ALC_APIENTRY *LPALCGETENUMVALUE)(ALCdevice *device, const ALCchar *enumname);
  173. typedef const ALCchar* (ALC_APIENTRY *LPALCGETSTRING)(ALCdevice *device, ALCenum param);
  174. typedef void (ALC_APIENTRY *LPALCGETINTEGERV)(ALCdevice *device, ALCenum param, ALCsizei size, ALCint *values);
  175. typedef ALCdevice* (ALC_APIENTRY *LPALCCAPTUREOPENDEVICE)(const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize);
  176. typedef ALCboolean (ALC_APIENTRY *LPALCCAPTURECLOSEDEVICE)(ALCdevice *device);
  177. typedef void (ALC_APIENTRY *LPALCCAPTURESTART)(ALCdevice *device);
  178. typedef void (ALC_APIENTRY *LPALCCAPTURESTOP)(ALCdevice *device);
  179. typedef void (ALC_APIENTRY *LPALCCAPTURESAMPLES)(ALCdevice *device, ALCvoid *buffer, ALCsizei samples);
  180. #if defined(__cplusplus)
  181. }
  182. #endif
  183. #endif /* AL_ALC_H */