diff options
author | Chris Robinson <[email protected]> | 2016-09-08 12:05:08 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2016-09-08 12:14:28 -0700 |
commit | 0f24f49a44a12d139692d0846b2722de2213f1a8 (patch) | |
tree | ed7a9c9954e56082a27bebfa07fc4c6fbce18c43 /examples/allatency.c | |
parent | b21e481827b660e7439fcebb505cdb0349517a54 (diff) |
Allow specifying the device to open for the examples
Diffstat (limited to 'examples/allatency.c')
-rw-r--r-- | examples/allatency.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/examples/allatency.c b/examples/allatency.c index afef43ca..56d96b9e 100644 --- a/examples/allatency.c +++ b/examples/allatency.c @@ -125,15 +125,16 @@ int main(int argc, char **argv) ALdouble offsets[2]; 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 source_latency support. */ + argv++; argc--; + if(InitAL(&argv, &argc) != 0) return 1; if(!alIsExtensionPresent("AL_SOFT_source_latency")) @@ -166,7 +167,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(); |