Skip to content

Commit

Permalink
GL: added noresizable option
Browse files Browse the repository at this point in the history
This option is (besides the obvious use-case) particularly useful when
window is bigger than active display resolution, in which case GLFW tend
to resize the window to fit the screen, which may not be always desired.
  • Loading branch information
MartinPulec committed Jan 15, 2024
1 parent e9eeec2 commit 5bc37c4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/video_display/gl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ static void gl_show_help(bool full) {
<< "\t\t\tsyntax: " TBOLD("[<W>x<H>][{+-}<X>[{+-}<Y>]]")
<< (full ? " [1]" : "") << "\n";
col() << TBOLD("\tfixed_size") << "\tdo not resize window on new stream\n";
col() << TBOLD("\tnoresizable") << "\twindow won't be resizable (useful with size=)\n";
#ifdef SPOUT
col() << TBOLD("\tspout") << "\t\tuse Spout (optionally with name)\n";
#endif
Expand Down Expand Up @@ -678,6 +679,8 @@ static void *display_gl_parse_fmt(struct state_gl *s, char *ptr) {
}
} else if (strcmp(tok, "fixed_size") == 0) {
s->fixed_size = true;
} else if (strcmp(tok, "noresizable") == 0) {
s->hints[GLFW_RESIZABLE] = GLFW_FALSE;
} else {
log_msg(LOG_LEVEL_ERROR, MOD_NAME "Unknown option: %s\n", tok);
return nullptr;
Expand Down

0 comments on commit 5bc37c4

Please sign in to comment.