aboutsummaryrefslogtreecommitdiffstats
path: root/examples/alreverb.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2016-09-08 12:05:08 -0700
committerChris Robinson <[email protected]>2016-09-08 12:14:28 -0700
commit0f24f49a44a12d139692d0846b2722de2213f1a8 (patch)
treeed7a9c9954e56082a27bebfa07fc4c6fbce18c43 /examples/alreverb.c
parentb21e481827b660e7439fcebb505cdb0349517a54 (diff)
Allow specifying the device to open for the examples
Diffstat (limited to 'examples/alreverb.c')
-rw-r--r--examples/alreverb.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/examples/alreverb.c b/examples/alreverb.c
index 7d2bb343..ec71f354 100644
--- a/examples/alreverb.c
+++ b/examples/alreverb.c
@@ -217,15 +217,16 @@ int main(int argc, char **argv)
ALuint source, buffer, effect, slot;
ALenum state;
- /* Print out usage if no file was specified */
+ /* Print out usage if no arguments were specified */
if(argc < 2)
{
- fprintf(stderr, "Usage: %s <filename>\n", argv[0]);
+ fprintf(stderr, "Usage: %s [-device <name] <filename>\n", argv[0]);
return 1;
}
- /* Initialize OpenAL with the default device, and check for EFX support. */
- if(InitAL() != 0)
+ /* Initialize OpenAL, and check for EFX support. */
+ argv++; argc--;
+ if(InitAL(&argv, &argc) != 0)
return 1;
if(!alcIsExtensionPresent(alcGetContextsDevice(alcGetCurrentContext()), "ALC_EXT_EFX"))
@@ -269,7 +270,7 @@ int main(int argc, char **argv)
#undef LOAD_PROC
/* Load the sound into a buffer. */
- buffer = LoadSound(argv[1]);
+ buffer = LoadSound(argv[0]);
if(!buffer)
{
CloseAL();