From 15e09eb6ecd4927e25d8bf9779b2c282915cbd8e Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 1 May 2022 11:25:49 +0200 Subject: [PATCH] fixed buggy resizing --- basegraph.cpp | 6 +++++- config.cpp | 12 ++++++------ netgen.cpp | 1 + 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/basegraph.cpp b/basegraph.cpp index 3360635b..dbf274a3 100644 --- a/basegraph.cpp +++ b/basegraph.cpp @@ -1104,6 +1104,10 @@ EX void compute_fsize() { EX bool graphics_on; +EX bool request_resolution_change; + +EX void do_request_resolution_change() { request_resolution_change = true; } + EX bool want_vsync() { if(vrhr::active()) return false; @@ -1117,7 +1121,7 @@ EX bool need_to_reopen_window() { return true; if(want_vsync() != vid.current_vsync) return true; - if(vid.usingGL && make_pair(vid.xres, vid.yres) != get_requested_resolution()) + if(request_resolution_change) return true; return false; } diff --git a/config.cpp b/config.cpp index a5d075b2..d5e9554d 100644 --- a/config.cpp +++ b/config.cpp @@ -759,27 +759,27 @@ EX void initConfig() { param_i(vid.fullscreen_x, "fullscreen_x", 1280) -> editable(640, 3840, 640, "fullscreen resolution to use (X)", "", 'x') - -> set_sets([] { dialog::bound_low(640); }); + -> set_sets([] { dialog::bound_low(640); dialog::reaction_final = do_request_resolution_change; }); param_i(vid.fullscreen_y, "fullscreen_y", 1024) -> editable(480, 2160, 480, "fullscreen resolution to use (Y)", "", 'x') - -> set_sets([] { dialog::bound_low(480); }); + -> set_sets([] { dialog::bound_low(480); dialog::reaction_final = do_request_resolution_change; }); param_i(vid.window_x, "window_x", 1280) -> editable(160, 3840, 160, "window resolution to use (X)", "", 'x') - -> set_sets([] { dialog::bound_low(160); }); + -> set_sets([] { dialog::bound_low(160); dialog::reaction_final = do_request_resolution_change; }); param_i(vid.window_y, "window_y", 1024) -> editable(120, 2160, 120, "window resolution to use (Y)", "", 'x') - -> set_sets([] { dialog::bound_low(120); }); + -> set_sets([] { dialog::bound_low(120); dialog::reaction_final = do_request_resolution_change; }); param_f(vid.window_rel_x, "window_rel_x", .9) -> editable(.1, 1, .1, "screen size percentage to use (X)", "", 'x') - -> set_sets([] { dialog::bound_low(.1); }); + -> set_sets([] { dialog::bound_low(.1); dialog::reaction_final = do_request_resolution_change; }); param_f(vid.window_rel_y, "window_rel_y", .9) -> editable(.1, 1, .1, "screen size percentage to use (Y)", "", 'x') - -> set_sets([] { dialog::bound_low(.1); }); + -> set_sets([] { dialog::bound_low(.1); dialog::reaction_final = do_request_resolution_change; }); param_b(vid.darkhepta, "mark heptagons", false); diff --git a/netgen.cpp b/netgen.cpp index 6ea15516..da047f90 100644 --- a/netgen.cpp +++ b/netgen.cpp @@ -686,6 +686,7 @@ EX namespace netgen { dynamicval dfs(vid.change_fullscr, true); dynamicval dcf(vid.want_fullscreen, false); dynamicval m(pmodel, mdPixel); + request_resolution_change = true; apply_screen_settings();