diff options
-rw-r--r-- | examples/openal-info.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/examples/openal-info.c b/examples/openal-info.c index df0bd88a..5af34bbc 100644 --- a/examples/openal-info.c +++ b/examples/openal-info.c @@ -129,9 +129,7 @@ static void checkForErrors(void) static void printDevices(ALCenum which, const char *kind) { const char *s = alcGetString(NULL, which); - checkForErrors(); - - printf("Available %sdevices:\n", kind); + printf("Available %s devices:\n", kind); if(s == NULL || *s == '\0') printf(" (none!)\n"); else do { @@ -146,17 +144,6 @@ static void printALCInfo (void) ALCint major, minor; ALCdevice *device; - if(alcIsExtensionPresent(NULL, (const ALCchar*)"ALC_ENUMERATION_EXT") == AL_TRUE) - { - if(alcIsExtensionPresent(NULL, (const ALCchar*)"ALC_ENUMERATE_ALL_EXT") == AL_TRUE) - printDevices(ALC_ALL_DEVICES_SPECIFIER, "playback "); - else - printDevices(ALC_DEVICE_SPECIFIER, "playback "); - printDevices(ALC_CAPTURE_DEVICE_SPECIFIER, "capture "); - } - else - printf("No device enumeration available\n"); - printf("Default device: %s\n", alcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER)); printf("Default capture device: %s\n", @@ -276,6 +263,17 @@ int main() ALCdevice *device; ALCcontext *context; + if(alcIsExtensionPresent(NULL, (const ALCchar*)"ALC_ENUMERATION_EXT") == AL_TRUE) + { + if(alcIsExtensionPresent(NULL, (const ALCchar*)"ALC_ENUMERATE_ALL_EXT") == AL_TRUE) + printDevices(ALC_ALL_DEVICES_SPECIFIER, "playback"); + else + printDevices(ALC_DEVICE_SPECIFIER, "playback"); + printDevices(ALC_CAPTURE_DEVICE_SPECIFIER, "capture"); + } + else + printf("No device enumeration available\n"); + device = alcOpenDevice(NULL); if(!device) { |