aboutsummaryrefslogtreecommitdiffstats
path: root/utils/openal-info.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2015-10-28 14:47:58 -0700
committerChris Robinson <[email protected]>2015-10-28 14:47:58 -0700
commit59c6fc966dbcb70ebb99a5d25b7db41085b34e72 (patch)
treec1fdc2123f73202c4e2eb73059830e9705a7056e /utils/openal-info.c
parent35c4aae3d6383ef809786b8ca1b4fa56fb98035f (diff)
Print enumerated HRTFs in openal-info
Diffstat (limited to 'utils/openal-info.c')
-rw-r--r--utils/openal-info.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/utils/openal-info.c b/utils/openal-info.c
index 61af00f0..5b45ceef 100644
--- a/utils/openal-info.c
+++ b/utils/openal-info.c
@@ -147,6 +147,35 @@ static void printALCInfo(ALCdevice *device)
}
}
+static void printHRTFInfo(ALCdevice *device)
+{
+ LPALCGETSTRINGISOFT alcGetStringiSOFT;
+ ALCint num_hrtfs;
+
+ if(alcIsExtensionPresent(device, "ALC_SOFT_HRTF") == ALC_FALSE)
+ {
+ printf("HRTF extension not available\n");
+ return;
+ }
+
+ alcGetStringiSOFT = alcGetProcAddress(device, "alcGetStringiSOFT");
+
+ alcGetIntegerv(device, ALC_NUM_HRTF_SPECIFIERS_SOFT, 1, &num_hrtfs);
+ if(!num_hrtfs)
+ printf("No HRTFs found\n");
+ else
+ {
+ ALCint i;
+ printf("Available HRTFs:\n");
+ for(i = 0;i < num_hrtfs;++i)
+ {
+ const ALCchar *name = alcGetStringiSOFT(device, ALC_HRTF_SPECIFIER_SOFT, i);
+ printf(" %s\n", name);
+ }
+ }
+ checkALCErrors(device);
+}
+
static void printALInfo(void)
{
printf("OpenAL vendor string: %s\n", alGetString(AL_VENDOR));
@@ -287,6 +316,7 @@ int main(int argc, char *argv[])
return 1;
}
printALCInfo(device);
+ printHRTFInfo(device);
context = alcCreateContext(device, NULL);
if(!context || alcMakeContextCurrent(context) == ALC_FALSE)