type
{$ifdef cgekernel}
  ALCboolean                        = cbool;
  PALCboolean                       = pcbool;
  ALCchar                           = cchar;
  PALCchar                          = pcchar;
  ALCbyte                           = cint8;
  PALCbyte                          = pcint8;
  ALCubyte                          = cuint8;
  PALCubyte                         = pcuint8;
  ALCshort                          = cint16;
  PALCshort                         = pcint16;
  ALCushort                         = cuint16;
  PALCushort                        = pcuint16;
  ALCint                            = cint32;
  PALCint                           = pcint32;
  ALCuint                           = cuint32;
  PALCuint                          = pcuint32;
  ALCsizei                          = cint32;
  PALCsizei                         = pcint32;
  ALCenum                           = cint32;
  PALCenum                          = pcint32;
  ALCfloat                          = cfloat;
  PALCfloat                         = pcfloat;
  ALCdouble                         = cdouble;
  PALCdouble                        = pcdouble;
  PALCvoid                          = pointer;
{$endif}
  ALboolean                         = cbool;
  PALboolean                        = pcbool;
  ALchar                            = cchar;
  PALchar                           = pcchar;
  ALbyte                            = cint8;
  PALbyte                           = pcint8;
  ALubyte                           = cuint8;
  PALubyte                          = pcuint8;
  ALshort                           = cint16;
  PALshort                          = pcint16;
  ALushort                          = cuint16;
  PALushort                         = pcuint16;
  ALint                             = cint32;
  PALint                            = pcint32;
  ALuint                            = cuint32;
  PALuint                           = pcuint32;
  ALsizei                           = cint32;
  PALsizei                          = pcint32;
  ALenum                            = cint32;
  PALenum                           = pcint32;
  ALfloat                           = cfloat;
  PALfloat                          = pcfloat;
  ALdouble                          = cdouble;
  PALdouble                         = pcdouble;
  PALvoid                           = pointer;


const
{$ifdef cgekernel}
  //only the mother module needs this.
  ALC_FALSE                         = 0;
  ALC_TRUE                          = 1;
  ALC_FREQUENCY                     = $1007;
  ALC_REFRESH                       = $1008;
  ALC_SYNC                          = $1009;
  ALC_MONO_SOURCES                  = $1010;
  ALC_STEREO_SOURCES                = $1011;
  ALC_NO_ERROR                      = ALC_FALSE;
  ALC_INVALID_DEVICE                = $A001;
  ALC_INVALID_CONTEXT               = $A002;
  ALC_INVALID_ENUM                  = $A003;
  ALC_INVALID_VALUE                 = $A004;
  ALC_OUT_OF_MEMORY                 = $A005;
  ALC_DEFAULT_DEVICE_SPECIFIER      = $1004;
  ALC_DEVICE_SPECIFIER              = $1005;
  ALC_EXTENSIONS                    = $1006;
  ALC_MAJOR_VERSION                 = $1000;
  ALC_MINOR_VERSION                 = $1001;
  ALC_ATTRIBUTES_SIZE               = $1002;
  ALC_ALL_ATTRIBUTES                = $1003;
{$endif}
  AL_NONE                           = 0;
  AL_FALSE                          = 0;
  AL_TRUE                           = 1;
  AL_SOURCE_RELATIVE                = $202;
  AL_CONE_INNER_ANGLE               = $1001;
  AL_CONE_OUTER_ANGLE               = $1002;
  AL_PITCH                          = $1003;
  AL_POSITION                       = $1004;
  AL_DIRECTION                      = $1005;
  AL_VELOCITY                       = $1006;
  AL_LOOPING                        = $1007;
  AL_BUFFER                         = $1009;
  AL_GAIN                           = $100A;
  AL_MIN_GAIN                       = $100D;
  AL_MAX_GAIN                       = $100E;
  AL_ORIENTATION                    = $100F;
  AL_SOURCE_STATE                   = $1010;
  AL_INITIAL                        = $1011;
  AL_PLAYING                        = $1012;
  AL_PAUSED                         = $1013;
  AL_STOPPED                        = $1014;
  AL_BUFFERS_QUEUED                 = $1015;
  AL_BUFFERS_PROCESSED              = $1016;
  AL_SEC_OFFSET                     = $1024;
  AL_SAMPLE_OFFSET                  = $1025;
  AL_BYTE_OFFSET                    = $1026;
  AL_SOURCE_TYPE                    = $1027;
  AL_STATIC                         = $1028;
  AL_STREAMING                      = $1029;
  AL_UNDETERMINED                   = $1030;
  AL_FORMAT_MONO8                   = $1100;
  AL_FORMAT_MONO16                  = $1101;
  AL_FORMAT_STEREO8                 = $1102;
  AL_FORMAT_STEREO16                = $1103;
  AL_REFERENCE_DISTANCE             = $1020;
  AL_ROLLOFF_FACTOR                 = $1021;
  AL_CONE_OUTER_GAIN                = $1022;
  AL_MAX_DISTANCE                   = $1023;
  AL_FREQUENCY                      = $2001;
  AL_BITS                           = $2002;
  AL_CHANNELS                       = $2003;
  AL_SIZE                           = $2004;
  AL_UNUSED                         = $2010;
  AL_PENDING                        = $2011;
  AL_PROCESSED                      = $2012;
  AL_NO_ERROR                       = AL_FALSE;
  AL_INVALID_NAME                   = $A001;
  AL_INVALID_ENUM                   = $A002;
  AL_INVALID_VALUE                  = $A003;
  AL_INVALID_OPERATION              = $A004;
  AL_OUT_OF_MEMORY                  = $A005;
  AL_VENDOR                         = $B001;
  AL_VERSION                        = $B002;
  AL_RENDERER                       = $B003;
  AL_EXTENSIONS                     = $B004;
  AL_DOPPLER_FACTOR                 = $C000;
  AL_DOPPLER_VELOCITY               = $C001;
  AL_SPEED_OF_SOUND                 = $C003;
  AL_DISTANCE_MODEL                 = $D000;
  AL_INVERSE_DISTANCE               = $D001;
  AL_INVERSE_DISTANCE_CLAMPED       = $D002;
  AL_LINEAR_DISTANCE                = $D003;
  AL_LINEAR_DISTANCE_CLAMPED        = $D004;
  AL_EXPONENT_DISTANCE              = $D005;
  AL_EXPONENT_DISTANCE_CLAMPED      = $D006;


var
  alcCreateContext: function (device: pointer; const attrlist: PALCint): pointer; cdecl = nil;
  alcMakeContextCurrent: function (context: pointer): ALCboolean; cdecl = nil;
  alcProcessContext: procedure (context: pointer); cdecl = nil;
  alcSuspendContext: procedure (context: pointer); cdecl = nil;
  alcDestroyContext: procedure (context: pointer); cdecl = nil;
  alcGetCurrentContext: function (): pointer; cdecl = nil;
  alcGetContextsDevice: function (context: pointer): pointer; cdecl = nil;
  alcOpenDevice: function (const devicename: PALCchar): pointer; cdecl = nil;
  alcCloseDevice: function (device: pointer): ALCboolean; cdecl = nil;
  alcGetError: function (device: pointer): ALCenum; cdecl = nil;
  alcGetString: function (device: pointer; param: ALCenum): PALCchar; cdecl = nil;
  alcGetIntegerv: procedure (device: pointer; param: ALCenum; size: ALCsizei; data: PALCint); cdecl = nil;
  alEnable: procedure (capability: ALenum); cdecl = nil;
  alDisable: procedure (capability: ALenum); cdecl = nil;
  alIsEnabled: function (capability: ALenum): ALboolean; cdecl = nil;
  alGetString: function (param: ALenum): PALchar; cdecl = nil;
  alGetBooleanv: procedure (param: ALenum; data: PALboolean); cdecl = nil;
  alGetIntegerv: procedure (param: ALenum; data: PALint); cdecl = nil;
  alGetFloatv: procedure (param: ALenum; data: PALfloat); cdecl = nil;
  alGetDoublev: procedure (param: ALenum; data: PALdouble); cdecl = nil;
  alGetBoolean: function (param: ALenum): ALboolean; cdecl = nil;
  alGetInteger: function (param: ALenum): ALint; cdecl = nil;
  alGetFloat: function (param: ALenum): ALfloat; cdecl = nil;
  alGetDouble: function (param: ALenum): ALdouble; cdecl = nil;
  alGetError: function (): ALenum; cdecl = nil;
  alIsExtensionPresent: function (const extname: PALChar): ALboolean; cdecl = nil;
  alGetProcAddress: function (const fname: PALChar): pointer; cdecl = nil;
  alGetEnumValue: function (const ename: PALChar): ALenum; cdecl = nil;
  alListenerf: procedure (param: ALenum; value: ALfloat); cdecl = nil;
  alListener3f: procedure (param: ALenum; value1, value2, value3: ALfloat); cdecl = nil;
  alListenerfv: procedure (param: ALenum; const values: PALfloat); cdecl = nil;
  alListeneri: procedure (param: ALenum; value: ALint); cdecl = nil;
  alListener3i: procedure (param: ALenum; value1, value2, value3: ALint); cdecl = nil;
  alListeneriv: procedure (param: ALenum; const values: PALint); cdecl = nil;
  alGetListenerf: procedure (param: ALenum; var value: ALfloat); cdecl = nil;
  alGetListener3f: procedure (param: ALenum; var value1, value2, value3: ALfloat); cdecl = nil;
  alGetListenerfv: procedure (param: ALenum; values: PALfloat); cdecl = nil;
  alGetListeneri: procedure (param: ALenum; var value: ALint); cdecl = nil;
  alGetListener3i: procedure (param: ALenum; var value1, value2, value3: ALint); cdecl = nil;
  alGetListeneriv: procedure (param: ALenum; values: PALint); cdecl = nil;
  alGenSources: procedure (n: ALsizei; sources: PALuint); cdecl = nil;
  alDeleteSources: procedure (n: ALsizei; const sources: PALuint); cdecl = nil;
  alIsSource: function (sid: ALuint): ALboolean; cdecl = nil;
  alSourcef: procedure (sid: ALuint; param: ALenum; value: ALfloat); cdecl = nil;
  alSource3f: procedure (sid: ALuint; param: ALenum; value1, value2, value3: ALfloat); cdecl = nil;
  alSourcefv: procedure (sid: ALuint; param: ALenum; const values: PALfloat); cdecl = nil;
  alSourcei: procedure (sid: ALuint; param: ALenum; value: ALint); cdecl = nil;
//  alSource3i: procedure (sid: ALuint; param: ALenum; value1, value2, value3: ALint); cdecl = nil;
//  alSourceiv: procedure (sid: ALuint; param: ALenum; const values: PALint); cdecl = nil;
  alGetSourcef: procedure (sid: ALuint; param: ALenum; var value: ALfloat); cdecl = nil;
  alGetSource3f: procedure (sid: ALuint; param: ALenum; var value1, value2, value3: ALfloat); cdecl = nil;
  alGetSourcefv: procedure (sid: ALuint; param: ALenum; values: PALfloat); cdecl = nil;
  alGetSourcei: procedure (sid: ALuint; param: ALenum; var value: ALint); cdecl = nil;
//  alGetSource3i: procedure (sid: ALuint; param: ALenum; var value1, value2, value3: ALint); cdecl = nil;
//  alGetSourceiv: procedure (sid: ALuint; param: ALenum; values: PALint); cdecl = nil;
  alSourcePlayv: procedure (ns: ALsizei; const sids: PALuint); cdecl = nil;
  alSourceStopv: procedure (ns: ALsizei; const sids: PALuint); cdecl = nil;
  alSourceRewindv: procedure (ns: ALsizei; const sids: PALuint); cdecl = nil;
  alSourcePausev: procedure (ns: ALsizei; const sids: PALuint); cdecl = nil;
  alSourcePlay: procedure (sid: ALuint); cdecl = nil;
  alSourceStop: procedure (sid: ALuint); cdecl = nil;
  alSourceRewind: procedure (sid: ALuint); cdecl = nil;
  alSourcePause: procedure (sid: ALuint); cdecl = nil;
  alSourceQueueBuffers: procedure (sid: ALuint; numEntries: ALsizei; const bids: PALuint); cdecl = nil;
  alSourceUnqueueBuffers: procedure (sid: ALuint; numEntries: ALsizei; bids: PALuint); cdecl = nil;
  alGenBuffers: procedure (n: ALsizei; buffers: PALuint); cdecl = nil;
  alDeleteBuffers: procedure (n: ALsizei; const buffers: PALuint); cdecl = nil;
  alIsBuffer: function (bid: ALuint): ALboolean; cdecl = nil;
  alBufferData: procedure (bid: ALuint; format: ALenum; data: PALvoid; size: ALsizei; freq: ALsizei); cdecl = nil;
  alBufferf: procedure (bid: ALuint; param: ALenum; value: ALfloat); cdecl = nil;
  alBuffer3f: procedure (bid: ALuint; param: ALenum; value1, value2, value3: ALfloat); cdecl = nil;
  alBufferfv: procedure (bid: ALuint; param: ALenum; const values: PALfloat); cdecl = nil;
  alBufferi: procedure (bid: ALuint; param: ALenum; value: ALint); cdecl = nil;
  alBuffer3i: procedure (bid: ALuint; param: ALenum; value1, value2, value3: ALint); cdecl = nil;
  alBufferiv: procedure (bid: ALuint; param: ALenum; const values: ALint); cdecl = nil;
  alGetBufferf: procedure (bid: ALuint; param: ALenum; var value: ALfloat); cdecl = nil;
  alGetBuffer3f: procedure (bid: ALuint; param: ALenum; var value1, value2, value3: ALfloat); cdecl = nil;
  alGetBufferfv: procedure (bid: ALuint; param: ALenum; values: PALfloat); cdecl = nil;
  alGetBufferi: procedure (bid: ALuint; param: ALenum; var value: ALint); cdecl = nil;
  alGetBuffer3i: procedure (bid: ALuint; param: ALenum; var value1, value2, value3: ALint); cdecl = nil;
  alGetBufferiv: procedure (bid: ALuint; param: ALenum; values: ALint); cdecl = nil;
  alDopplerFactor: procedure (value: ALfloat); cdecl = nil;
  alDopplerVelocity: procedure (value: ALfloat); cdecl = nil;
  alSpeedOfSound: procedure (value: ALfloat); cdecl = nil;
  alDistanceModel: procedure (distanceModel: ALenum); cdecl = nil;






