Skip to content

Commit 0953b8c

Browse files
committed
vdisp/gl: accept also mode names for size=
1 parent 9c597ae commit 0953b8c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/video_display/gl.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,10 @@ static void gl_show_help(bool full) {
547547
<< "\twindow size in pixels, with optional position; full\n"
548548
<< "\t\t\tsyntax: " TBOLD("[<W>x<H>][{+-}<X>[{+-}<Y>]]")
549549
<< (full ? " [1]" : "") << "\n";
550+
if (full) {
551+
col() << TBOLD("\tsize=<mode_name>")
552+
<< " mode name (eg. VGA), use \"help\" to show\n";
553+
}
550554
col() << TBOLD("\tfixed_size") << "\tdo not resize window on new stream\n";
551555
col() << TBOLD("\tnoresizable") << "\twindow won't be resizable (useful with size=)\n";
552556
#ifdef SPOUT
@@ -614,6 +618,13 @@ static bool set_size(struct state_gl *s, const char *tok)
614618
if (strchr(tok, '%') != NULL) {
615619
s->window_size_factor = atof(tok) / 100.0;
616620
} else if (strpbrk(tok, "x+-") == NULL) {
621+
struct video_desc desc = get_video_desc_from_string(tok);
622+
if (desc.width != 0) {
623+
s->fixed_size = true;
624+
s->fixed_w = desc.width;
625+
s->fixed_h = desc.height;
626+
return true;
627+
}
617628
log_msg(LOG_LEVEL_ERROR, MOD_NAME "Wrong size spec: %s\n", tok);
618629
return false;
619630
}

0 commit comments

Comments
 (0)