]> git.sesse.net Git - nageru/blobdiff - flags.cpp
Add an option to not flush PBOs explicitly; causes apitrace not to store the data...
[nageru] / flags.cpp
index f8fea018ea89add3c754a604cfea5973eff1cc63..ffba26961e082c29ee2b8d293dbca5007c6cac13 100644 (file)
--- a/flags.cpp
+++ b/flags.cpp
@@ -6,13 +6,32 @@
 
 Flags global_flags;
 
+void usage()
+{
+       fprintf(stderr, "Usage: nageru [OPTION]...\n");
+       fprintf(stderr, "\n");
+       fprintf(stderr, "  -h, --help                      print usage information\n");
+       fprintf(stderr, "  -c, --num-cards                 set number of input cards (default 2)\n");
+       fprintf(stderr, "  -t, --theme=FILE                choose theme (default theme.lua)\n");
+       fprintf(stderr, "  -v, --va-display=SPEC           VA-API device for H.264 encoding\n");
+       fprintf(stderr, "                                    ($DISPLAY spec or /dev/dri/render* path)\n");
+       fprintf(stderr, "      --http-uncompressed-video   send uncompressed NV12 video to HTTP clients\n");
+       fprintf(stderr, "      --flat-audio                start with most audio processing turned off\n");
+       fprintf(stderr, "      --no-flush-pbos             do not explicitly signal texture data uploads\n");
+       fprintf(stderr, "                                    (will give display corruption, but makes it\n");
+       fprintf(stderr, "                                    possible to run with apitrace in real time)\n");
+}
+
 void parse_flags(int argc, char * const argv[])
 {
        static const option long_options[] = {
+               { "help", no_argument, 0, 'h' },
                { "num-cards", required_argument, 0, 'c' },
                { "theme", required_argument, 0, 't' },
                { "va-display", required_argument, 0, 1000 },
                { "http-uncompressed-video", no_argument, 0, 1001 },
+               { "flat-audio", no_argument, 0, 1002 },
+               { "no-flush-pbos", no_argument, 0, 1003 },
                { 0, 0, 0, 0 }
        };
        for ( ;; ) {
@@ -35,8 +54,19 @@ void parse_flags(int argc, char * const argv[])
                case 1001:
                        global_flags.uncompressed_video_to_http = true;
                        break;
+               case 1002:
+                       global_flags.flat_audio = true;
+                       break;
+               case 1003:
+                       global_flags.flush_pbos = false;
+                       break;
+               case 'h':
+                       usage();
+                       exit(0);
                default:
                        fprintf(stderr, "Unknown option '%s'\n", argv[option_index]);
+                       fprintf(stderr, "\n");
+                       usage();
                        exit(1);
                }
        }