From 14b23c250268f01fbb5f0ed0ae8ff22c6a5c2810 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 3 May 2017 04:53:22 -0700 Subject: Print available resamplers in openal-info --- utils/openal-info.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/utils/openal-info.c b/utils/openal-info.c index 5fd8784b..617550f2 100644 --- a/utils/openal-info.c +++ b/utils/openal-info.c @@ -251,6 +251,38 @@ static void printALInfo(void) checkALErrors(); } +static void printResamplerInfo(void) +{ + LPALGETSTRINGISOFT alGetStringiSOFT; + ALint num_resamplers; + ALint def_resampler; + + if(!alIsExtensionPresent("AL_SOFT_source_resampler")) + { + printf("Resampler info not available\n"); + return; + } + + alGetStringiSOFT = alGetProcAddress("alGetStringiSOFT"); + + num_resamplers = alGetInteger(AL_NUM_RESAMPLERS_SOFT); + def_resampler = alGetInteger(AL_DEFAULT_RESAMPLER_SOFT); + + if(!num_resamplers) + printf("!!! No resamplers found !!!\n"); + else + { + ALint i; + printf("Available resamplers:\n"); + for(i = 0;i < num_resamplers;++i) + { + const ALchar *name = alGetStringiSOFT(AL_RESAMPLER_NAME_SOFT, i); + printf(" %s%s\n", name, (i==def_resampler)?" *":""); + } + } + checkALErrors(); +} + static void printEFXInfo(ALCdevice *device) { ALCint major, minor, sends; @@ -394,6 +426,7 @@ int main(int argc, char *argv[]) } printALInfo(); + printResamplerInfo(); printEFXInfo(device); alcMakeContextCurrent(NULL); -- cgit v1.2.3