aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-04-16 23:16:48 -0700
committerChris Robinson <[email protected]>2012-04-16 23:27:13 -0700
commit9a3eb397f4e39b293b6dfd3f539161fde3c70977 (patch)
treef03599efb7fdbab81455314ba8dcf3747c4de814 /utils
parent84c1f2bfd0daee3699c5f5994acf990cca2e5af7 (diff)
Print the device name in printALCInfo
Diffstat (limited to 'utils')
-rw-r--r--utils/openal-info.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/utils/openal-info.c b/utils/openal-info.c
index f291e1cd..61af00f0 100644
--- a/utils/openal-info.c
+++ b/utils/openal-info.c
@@ -125,6 +125,16 @@ static void printALCInfo(ALCdevice *device)
{
ALCint major, minor;
+ if(device)
+ {
+ const ALCchar *devname = NULL;
+ printf("\n");
+ if(alcIsExtensionPresent(device, "ALC_ENUMERATE_ALL_EXT") != AL_FALSE)
+ devname = alcGetString(device, ALC_ALL_DEVICES_SPECIFIER);
+ if(checkALCErrors(device) != ALC_NO_ERROR || !devname)
+ devname = alcGetString(device, ALC_DEVICE_SPECIFIER);
+ printf("** Info for device \"%s\" **\n", devname);
+ }
alcGetIntegerv(device, ALC_MAJOR_VERSION, 1, &major);
alcGetIntegerv(device, ALC_MINOR_VERSION, 1, &minor);
if(checkALCErrors(device) == ALC_NO_ERROR)
@@ -276,11 +286,6 @@ int main(int argc, char *argv[])
printf("\n!!! Failed to open %s !!!\n\n", ((argc>1) ? argv[1] : "default device"));
return 1;
}
-
- if(alcIsExtensionPresent(device, "ALC_ENUMERATE_ALL_EXT") != AL_FALSE)
- printf("\n** Info for device \"%s\" **\n", alcGetString(device, ALC_ALL_DEVICES_SPECIFIER));
- else
- printf("\n** Info for device \"%s\" **\n", alcGetString(device, ALC_DEVICE_SPECIFIER));
printALCInfo(device);
context = alcCreateContext(device, NULL);