mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-03-12 22:56:52 +01:00
VideoCommon/RenderBase: Reset scissor rectangle after ImGui rendering
This fixes the problem where OBS game capture only grabs the region inside an ImGui window whenever one is open, when using the OpenGL backend. Shouldn't have any negative effects, as the scissor would've been something completely arbitrary anyways. This may affect other capture software that uses the same hooking method, but I've only tested OBS.
This commit is contained in:
parent
c34388f75b
commit
56c818b3d8
@ -1148,6 +1148,15 @@ void Renderer::DrawImGui()
|
|||||||
base_index += cmd.ElemCount;
|
base_index += cmd.ElemCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Some capture software (such as OBS) hooks SwapBuffers and uses glBlitFramebuffer to copy our
|
||||||
|
// back buffer just before swap. Because glBlitFramebuffer honors the scissor test, the capture
|
||||||
|
// itself will be clipped to whatever bounds were last set by ImGui, resulting in a rather useless
|
||||||
|
// capture whenever any ImGui windows are open. We'll reset the scissor rectangle to the entire
|
||||||
|
// viewport here to avoid this problem.
|
||||||
|
SetScissorRect(ConvertFramebufferRectangle(
|
||||||
|
MathUtil::Rectangle<int>(0, 0, m_backbuffer_width, m_backbuffer_height),
|
||||||
|
m_current_framebuffer));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_lock<std::mutex> Renderer::GetImGuiLock()
|
std::unique_lock<std::mutex> Renderer::GetImGuiLock()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user