Skip to content

Commit

Permalink
* Fixed an issue with the OGL renderer where it would present to the …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
harrand committed Jan 24, 2023
1 parent ca733d3 commit 4c88695
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/tz/gl/impl/opengl/renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit 4c88695

Please sign in to comment.