From 4c88695afe9b05cc879e5186b0bf911c752cc999 Mon Sep 17 00:00:00 2001 From: Harrand Date: Tue, 24 Jan 2023 04:12:37 +0000 Subject: [PATCH] * Fixed an issue with the OGL renderer where it would present to the screen even if the renderer output was an offscreen image (although of course what is presented to the screen was something out-of-date). Fixed now and matches vulkan's behaviour --- src/tz/gl/impl/opengl/renderer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tz/gl/impl/opengl/renderer.cpp b/src/tz/gl/impl/opengl/renderer.cpp index d7f353a6c4..61577f4f85 100644 --- a/src/tz/gl/impl/opengl/renderer.cpp +++ b/src/tz/gl/impl/opengl/renderer.cpp @@ -559,6 +559,7 @@ namespace tz::gl } else { + const bool window_output = this->output.get_output() == nullptr || this->output.get_output()->get_target() == tz::gl::output_target::window; this->resources.write_dynamic_images(); { auto col = this->state.graphics.clear_colour; @@ -621,7 +622,7 @@ namespace tz::gl this->vao.draw(this->state.graphics.tri_count, this->shader.has_tessellation()); } } - if(!this->options.contains(tz::gl::renderer_option::no_present)) + if(!this->options.contains(tz::gl::renderer_option::no_present) && window_output) { tz::window().update(); }