diff options
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r-- | Alc/ALc.c | 46 |
1 files changed, 42 insertions, 4 deletions
@@ -27,6 +27,7 @@ #include <stdio.h> #include <memory.h> #include "alMain.h" +#include "alSource.h" #include "AL/al.h" #include "AL/alc.h" #include "alThunk.h" @@ -66,6 +67,9 @@ struct { /////////////////////////////////////////////////////// +#define ALC_EFX_MAJOR_VERSION 0x20001 +#define ALC_EFX_MINOR_VERSION 0x20002 +#define ALC_MAX_AUXILIARY_SENDS 0x20003 /////////////////////////////////////////////////////// // STRING and EXTENSIONS @@ -86,6 +90,7 @@ static ALCextension alcExtensions[] = { { "ALC_ENUMERATE_ALL_EXT", (ALvoid *) NULL }, { "ALC_ENUMERATION_EXT", (ALvoid *) NULL }, { "ALC_EXT_CAPTURE", (ALvoid *) NULL }, + { "ALC_EXT_EFX", (ALvoid *) NULL }, { NULL, (ALvoid *) NULL } }; @@ -135,9 +140,14 @@ static ALenums enumeration[]={ { (ALchar *)"ALC_MONO_SOURCES", ALC_MONO_SOURCES }, { (ALchar *)"ALC_STEREO_SOURCES", ALC_STEREO_SOURCES }, { (ALchar *)"ALC_CAPTURE_DEVICE_SPECIFIER", ALC_CAPTURE_DEVICE_SPECIFIER }, - { (ALchar *)"ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER", ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER }, + { (ALchar *)"ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER", ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER}, { (ALchar *)"ALC_CAPTURE_SAMPLES", ALC_CAPTURE_SAMPLES }, + // EFX Properties + { (ALchar *)"ALC_EFX_MAJOR_VERSION", ALC_EFX_MAJOR_VERSION }, + { (ALchar *)"ALC_EFX_MINOR_VERSION", ALC_EFX_MINOR_VERSION }, + { (ALchar *)"ALC_MAX_AUXILIARY_SENDS", ALC_MAX_AUXILIARY_SENDS }, + // ALC Error Message { (ALchar *)"ALC_NO_ERROR", ALC_NO_ERROR }, { (ALchar *)"ALC_INVALID_DEVICE", ALC_INVALID_DEVICE }, @@ -165,10 +175,13 @@ static ALCchar *alcDefaultAllDeviceSpecifier = alcAllDeviceList; static ALCchar *alcCaptureDefaultDeviceSpecifier = alcCaptureDeviceList; -static ALCchar alcExtensionList[] = "ALC_ENUMERATE_ALL_EXT ALC_ENUMERATION_EXT ALC_EXT_CAPTURE"; +static ALCchar alcExtensionList[] = "ALC_ENUMERATE_ALL_EXT ALC_ENUMERATION_EXT ALC_EXT_CAPTURE ALC_EXT_EFX"; static ALCint alcMajorVersion = 1; static ALCint alcMinorVersion = 1; +static ALCint alcEFXMajorVersion = 1; +static ALCint alcEFXMinorVersion = 0; + /////////////////////////////////////////////////////// @@ -331,6 +344,7 @@ static ALvoid InitContext(ALCcontext *pContext) { //Initialise listener pContext->Listener.Gain = 1.0f; + pContext->Listener.MetersPerUnit = 1.0f; pContext->Listener.Position[0] = 0.0f; pContext->Listener.Position[1] = 0.0f; pContext->Listener.Position[2] = 0.0f; @@ -671,13 +685,34 @@ ALCAPI ALCvoid ALCAPIENTRY alcGetIntegerv(ALCdevice *device,ALCenum param,ALsize *data = alcMinorVersion; break; + case ALC_EFX_MAJOR_VERSION: + if(!size) + SetALCError(ALC_INVALID_VALUE); + else + *data = alcEFXMajorVersion; + break; + + case ALC_EFX_MINOR_VERSION: + if(!size) + SetALCError(ALC_INVALID_VALUE); + else + *data = alcEFXMinorVersion; + break; + + case ALC_MAX_AUXILIARY_SENDS: + if(!size) + SetALCError(ALC_INVALID_VALUE); + else + *data = MAX_SENDS; + break; + case ALC_ATTRIBUTES_SIZE: if(!device) SetALCError(ALC_INVALID_DEVICE); else if(!size) SetALCError(ALC_INVALID_VALUE); else - *data = 11; + *data = 12; break; case ALC_ALL_ATTRIBUTES: @@ -699,13 +734,16 @@ ALCAPI ALCvoid ALCAPIENTRY alcGetIntegerv(ALCdevice *device,ALCenum param,ALsize data[i++] = ALC_FALSE; SuspendContext(NULL); - if(device->Context && size >= 11) + if(device->Context && size >= 12) { data[i++] = ALC_MONO_SOURCES; data[i++] = device->Context->lNumMonoSources; data[i++] = ALC_STEREO_SOURCES; data[i++] = device->Context->lNumStereoSources; + + data[i++] = ALC_MAX_AUXILIARY_SENDS; + data[i++] = MAX_SENDS; } ProcessContext(NULL); |