From f5fca108d7f6124adb9c980f762ece989465c6e9 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Thu, 14 Dec 2017 08:04:54 +0100 Subject: [PATCH] gs-rendertarget: Fix missing initialization --- source/gs-rendertarget.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/gs-rendertarget.cpp b/source/gs-rendertarget.cpp index c1174bcc..65428740 100644 --- a/source/gs-rendertarget.cpp +++ b/source/gs-rendertarget.cpp @@ -27,6 +27,7 @@ extern "C" { } GS::RenderTarget::RenderTarget(gs_color_format colorFormat, gs_zstencil_format zsFormat) { + m_isBeingRendered = false; obs_enter_graphics(); m_renderTarget = gs_texrender_create(colorFormat, zsFormat); obs_leave_graphics(); @@ -55,6 +56,7 @@ GS::RenderTargetOp::RenderTargetOp(GS::RenderTarget* rt, uint32_t width, uint32_ if (m_renderTarget->m_isBeingRendered) throw std::logic_error("Can't start rendering to the same render target twice."); obs_enter_graphics(); + gs_texrender_reset(m_renderTarget->m_renderTarget); if (!gs_texrender_begin(m_renderTarget->m_renderTarget, width, height)) { obs_leave_graphics(); throw std::runtime_error("Failed to begin rendering to render target.");