optionally source assets from URL
[laserbrain_demo] / src / opt.cc
index b5ab7ed..7f3d4bb 100644 (file)
@@ -12,7 +12,8 @@ Options def_opt = {
        false,  // fullscreen
        0,              // scene file
        true,   // music
-       true    // reflections
+       true,   // reflections
+       0               // data url
 };
 
 enum {
@@ -23,6 +24,7 @@ enum {
        OPT_SCENEFILE,
        OPT_MUSIC,
        OPT_REFLECT,
+       OPT_DATAURL,
        OPT_HELP
 };
 
@@ -35,6 +37,7 @@ static optcfg_option options[] = {
        {0, "scene", OPT_SCENEFILE, "scene file to open"},
        {'m', "music", OPT_MUSIC, "play background audio"},
        {'r', "reflect", OPT_REFLECT, "render reflections"},
+       {0, "url", OPT_DATAURL, "data URL"},
        {'h', "help", OPT_HELP, "print usage and exit"},
        OPTCFG_OPTIONS_END
 };
@@ -109,6 +112,10 @@ static int opt_handler(optcfg *oc, int optid, void *cls)
                opt.reflect = is_enabled(oc);
                break;
 
+       case OPT_DATAURL:
+               opt.data_url = strdup(optcfg_next_value(oc));
+               break;
+
        case OPT_HELP:
                printf("Usage: demo [options]\nOptions:\n");
                optcfg_print_options(oc);