mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-11-11 06:15:05 +00:00
gs-rendertarget: Fix missing initialization
This commit is contained in:
parent
e7bbb213a4
commit
f5fca108d7
1 changed files with 2 additions and 0 deletions
|
@ -27,6 +27,7 @@ extern "C" {
|
||||||
}
|
}
|
||||||
|
|
||||||
GS::RenderTarget::RenderTarget(gs_color_format colorFormat, gs_zstencil_format zsFormat) {
|
GS::RenderTarget::RenderTarget(gs_color_format colorFormat, gs_zstencil_format zsFormat) {
|
||||||
|
m_isBeingRendered = false;
|
||||||
obs_enter_graphics();
|
obs_enter_graphics();
|
||||||
m_renderTarget = gs_texrender_create(colorFormat, zsFormat);
|
m_renderTarget = gs_texrender_create(colorFormat, zsFormat);
|
||||||
obs_leave_graphics();
|
obs_leave_graphics();
|
||||||
|
@ -55,6 +56,7 @@ GS::RenderTargetOp::RenderTargetOp(GS::RenderTarget* rt, uint32_t width, uint32_
|
||||||
if (m_renderTarget->m_isBeingRendered)
|
if (m_renderTarget->m_isBeingRendered)
|
||||||
throw std::logic_error("Can't start rendering to the same render target twice.");
|
throw std::logic_error("Can't start rendering to the same render target twice.");
|
||||||
obs_enter_graphics();
|
obs_enter_graphics();
|
||||||
|
gs_texrender_reset(m_renderTarget->m_renderTarget);
|
||||||
if (!gs_texrender_begin(m_renderTarget->m_renderTarget, width, height)) {
|
if (!gs_texrender_begin(m_renderTarget->m_renderTarget, width, height)) {
|
||||||
obs_leave_graphics();
|
obs_leave_graphics();
|
||||||
throw std::runtime_error("Failed to begin rendering to render target.");
|
throw std::runtime_error("Failed to begin rendering to render target.");
|
||||||
|
|
Loading…
Reference in a new issue