- added option to disable mirror rendering
if(!rend->init()) {
return false;
}
if(!rend->init()) {
return false;
}
+ if(opt.reflect) {
+ rend->ropt |= RENDER_MIRRORS;
+ } else {
+ rend->ropt &= ~RENDER_MIRRORS;
+ }
rend->set_scene(mscn);
glUseProgram(0);
rend->set_scene(mscn);
glUseProgram(0);
FlatMirror *m = new FlatMirror;
m->wplane = mir->wplane;
m->next = planes;
FlatMirror *m = new FlatMirror;
m->wplane = mir->wplane;
m->next = planes;
mir->objects.push_back(obj);
objmirror[obj] = mir; // associate with object
mir->objects.push_back(obj);
objmirror[obj] = mir; // associate with object
false, // vr
false, // fullscreen
0, // scene file
false, // vr
false, // fullscreen
0, // scene file
+ true, // music
+ true // reflections
OPT_WINDOWED,
OPT_SCENEFILE,
OPT_MUSIC,
OPT_WINDOWED,
OPT_SCENEFILE,
OPT_MUSIC,
{'w', "windowed", OPT_WINDOWED, "run in windowed mode"},
{0, "scene", OPT_SCENEFILE, "scene file to open"},
{'m', "music", OPT_MUSIC, "play background audio"},
{'w', "windowed", OPT_WINDOWED, "run in windowed mode"},
{0, "scene", OPT_SCENEFILE, "scene file to open"},
{'m', "music", OPT_MUSIC, "play background audio"},
+ {'r', "reflect", OPT_REFLECT, "render reflections"},
{'h', "help", OPT_HELP, "print usage and exit"},
OPTCFG_OPTIONS_END
};
{'h', "help", OPT_HELP, "print usage and exit"},
OPTCFG_OPTIONS_END
};
opt.music = is_enabled(oc);
break;
opt.music = is_enabled(oc);
break;
+ case OPT_REFLECT:
+ opt.reflect = is_enabled(oc);
+ break;
+
case OPT_HELP:
printf("Usage: demo [options]\nOptions:\n");
optcfg_print_options(oc);
case OPT_HELP:
printf("Usage: demo [options]\nOptions:\n");
optcfg_print_options(oc);
bool fullscreen;
const char *scenefile;
bool music;
bool fullscreen;
const char *scenefile;
bool music;
};
extern Options opt, def_opt;
};
extern Options opt, def_opt;