[client] add renderer option list

This commit is contained in:
Geoffrey McRae 2017-12-17 22:33:02 +11:00
parent 06e38d897d
commit 424dc8bb13
2 changed files with 27 additions and 2 deletions

View file

@ -951,6 +951,7 @@ void doHelp(char * app)
"\n"
" -k Enable FPS display\n"
" -o FLAG Specify a renderer option (ie: opengl:vsync=0)\n"
" Alternatively specify \"list\" to list all renderer's and options\n"
"\n"
" -a Auto resize the window to the guest\n"
" -n Don't allow the window to be manually resized\n"
@ -1043,6 +1044,20 @@ int main(int argc, char * argv[])
case 'o':
{
if (strcasecmp(optarg, "list") == 0)
{
fprintf(stderr, "\nRenderer Option List\n");
for(unsigned int i = 0; i < LG_RENDERER_COUNT; ++i)
{
const LG_Renderer * r = LG_Renderers[i];
fprintf(stderr, "\n%s\n", r->get_name());
for(unsigned int i = 0; i < r->option_count; ++i)
fprintf(stderr, " %10s - %s\n", r->options[i].name, r->options[i].desc);
}
fprintf(stderr, "\n");
return -1;
}
const LG_Renderer * renderer = NULL;
RendererOpts * opts = NULL;

View file

@ -800,8 +800,18 @@ static void handle_opt_vsync(void * opaque, const char *value)
static LG_RendererOpt lgr_opengl_options[] =
{
{ .name = "mipmap", .validator = LG_RendererValidatorBool, .handler = handle_opt_mipmap },
{ .name = "vsync" , .validator = LG_RendererValidatorBool, .handler = handle_opt_vsync }
{
.name = "mipmap",
.desc = "Enable or disable mipmapping [default: enabled]",
.validator = LG_RendererValidatorBool,
.handler = handle_opt_mipmap
},
{
.name = "vsync",
.desc ="Enable or disable vsync [default: enabled]",
.validator = LG_RendererValidatorBool,
.handler = handle_opt_vsync
}
};
const LG_Renderer LGR_OpenGL =