From 540332d71c2d4f5055ccfe8180a1b66237d6c2a1 Mon Sep 17 00:00:00 2001 From: Danilo Date: Fri, 2 Aug 2024 17:17:33 -0300 Subject: [PATCH] =?UTF-8?q?Corre=C3=A7=C3=A3o=20em=20RenderTarget2D::Apply?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- framework/platform-dx/rendertarget.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/framework/platform-dx/rendertarget.cpp b/framework/platform-dx/rendertarget.cpp index d154417..d89678b 100644 --- a/framework/platform-dx/rendertarget.cpp +++ b/framework/platform-dx/rendertarget.cpp @@ -37,8 +37,10 @@ namespace xna { Exception::Throw(Exception::FAILED_TO_APPLY); } - if(!render_impl->_renderTargetView) - Exception::Throw(Exception::INVALID_OPERATION); + if (!render_impl->_renderTargetView) + { + Initialize(); + } auto& context = m_device->impl->_context; context->OMSetRenderTargets(1, render_impl->_renderTargetView.GetAddressOf(), nullptr);