Options def_opt = {
1280, 800,
false, // vr
- false // fullscreen
+ false, // fullscreen
+ 0, // scene file
+ true // music
};
enum {
OPT_SIZE,
OPT_VR,
- OPT_SRGB,
OPT_FULLSCREEN,
OPT_WINDOWED,
+ OPT_SCENEFILE,
+ OPT_MUSIC,
OPT_HELP
};
{0, "vr", OPT_VR, "enable VR mode"},
{'f', "fullscreen", OPT_FULLSCREEN, "run in fullscreen mode"},
{'w', "windowed", OPT_WINDOWED, "run in windowed mode"},
+ {0, "scene", OPT_SCENEFILE, "scene file to open"},
+ {'m', "music", OPT_MUSIC, "play background audio"},
{'h', "help", OPT_HELP, "print usage and exit"},
OPTCFG_OPTIONS_END
};
opt.fullscreen = !is_enabled(oc);
break;
+ case OPT_SCENEFILE:
+ opt.scenefile = strdup(optcfg_next_value(oc));
+ break;
+
+ case OPT_MUSIC:
+ opt.music = is_enabled(oc);
+ break;
+
case OPT_HELP:
- printf("Usage: vrfileman [options]\nOptions:\n");
+ printf("Usage: demo [options]\nOptions:\n");
optcfg_print_options(oc);
exit(0);
}
static int arg_handler(optcfg *oc, const char *arg, void *cls)
{
- fprintf(stderr, "unexpected argument: %s\n", arg);
- return -1;
+ if(opt.scenefile) {
+ fprintf(stderr, "unexpected argument: %s\n", arg);
+ return -1;
+ }
+ opt.scenefile = arg;
+ return 0;
}