[gfx] fixes for when the window is force to weird size

This commit is contained in:
water
2022-07-15 13:05:27 -04:00
parent 16d8f6b59d
commit 85dbc2ea89
3 changed files with 6 additions and 4 deletions
+2 -2
View File
@@ -73,8 +73,8 @@ static constexpr int PAT_MAT_COUNT = 23;
struct GfxGlobalSettings {
// note: this is actually the size of the display that ISN'T letterboxed
// the excess space is what will be letterboxed away.
int lbox_w;
int lbox_h;
int lbox_w = 640;
int lbox_h = 480;
// actual game resolution
int game_res_w = 640;
@@ -483,6 +483,7 @@ void OpenGLRenderer::setup_frame(const RenderOptions& settings) {
} else {
lg::error("bad framebuffer setup. fbo: {}, tex: {}, zbuf: {}, fbo2: {}, tex2: {}",
fbo_state.fbo, fbo_state.tex, fbo_state.zbuf, fbo_state.fbo2, fbo_state.tex2);
lg::error("size was: {} x {}\n", fbo_state.width, fbo_state.height);
fbo_state.delete_objects();
}
} else {
+3 -2
View File
@@ -517,8 +517,9 @@ void GLDisplay::render() {
// render game!
if (g_gfx_data->debug_gui.should_advance_frame()) {
auto p = scoped_prof("game-render");
render_game_frame(Gfx::g_global_settings.game_res_w, Gfx::g_global_settings.game_res_h, win_w,
win_h, lbox_w, lbox_h, Gfx::g_global_settings.msaa_samples);
render_game_frame(windowed() ? win_w : Gfx::g_global_settings.game_res_w,
windowed() ? win_h : Gfx::g_global_settings.game_res_h, win_w, win_h, lbox_w,
lbox_h, Gfx::g_global_settings.msaa_samples);
}
if (g_gfx_data->debug_gui.should_gl_finish()) {