goatvr_recenter();
}
- int srgb_capable;
- glGetIntegerv(GL_FRAMEBUFFER_SRGB_CAPABLE_EXT, &srgb_capable);
- printf("Framebuffer %s sRGB-capable\n", srgb_capable ? "is" : "is not");
- fb_srgb = srgb_capable != 0;
- glEnable(GL_FRAMEBUFFER_SRGB);
+ if(fb_srgb) {
+ int srgb_capable;
+ glGetIntegerv(GL_FRAMEBUFFER_SRGB_CAPABLE_EXT, &srgb_capable);
+ printf("Framebuffer %s sRGB-capable\n", srgb_capable ? "is" : "is not");
+ if(srgb_capable) {
+ glEnable(GL_FRAMEBUFFER_SRGB);
+ }
+ }
glEnable(GL_MULTISAMPLE);
glEnable(GL_DEPTH_TEST);
app_grab_mouse(true);
}
- if(mscn->music) {
+ if(mscn->music && opt.music) {
mscn->music->play(AUDIO_PLAYMODE_LOOP);
}
return true;
int val;
SDL_GL_GetAttribute(SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, &val);
printf("SDL says we %s an sRGB framebuffer\n", val ? "got" : "didn't get");
+ fb_srgb = val;
if(!(ctx = SDL_GL_CreateContext(win))) {
fprintf(stderr, "failed to create OpenGL context\n");
1280, 800,
false, // vr
false, // fullscreen
- 0 // scene file
+ 0, // scene file
+ true // music
};
enum {
OPT_FULLSCREEN,
OPT_WINDOWED,
OPT_SCENEFILE,
+ OPT_MUSIC,
OPT_HELP
};
{'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.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);
}