summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/RenderBase.cpp
diff options
context:
space:
mode:
authorStenzek <stenzek@gmail.com>2018-10-10 21:41:52 +1000
committerStenzek <stenzek@gmail.com>2019-01-25 11:15:57 +1000
commit36ce47635bd6b7287252fd87847629c853dabb6f (patch)
tree31eb1d58e4c9b3f9c4262a7ee9cc40ead5f46c3b /Source/Core/VideoCommon/RenderBase.cpp
parent63dd91628de0c9e8c7a25c403b7900675c515d36 (diff)
RenderWidget: Hook up to ImGui
Diffstat (limited to 'Source/Core/VideoCommon/RenderBase.cpp')
-rw-r--r--Source/Core/VideoCommon/RenderBase.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/RenderBase.cpp b/Source/Core/VideoCommon/RenderBase.cpp
index 76f3d29864..dd988b3f5c 100644
--- a/Source/Core/VideoCommon/RenderBase.cpp
+++ b/Source/Core/VideoCommon/RenderBase.cpp
@@ -812,9 +812,18 @@ void Renderer::DrawImGui()
}
}
+std::unique_lock<std::mutex> Renderer::GetImGuiLock()
+{
+ return std::unique_lock<std::mutex>(m_imgui_mutex);
+}
+
void Renderer::Swap(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, const EFBRectangle& rc,
u64 ticks)
{
+ // Hold the imgui lock while we're presenting.
+ // It's only to prevent races on inputs anyway, at this point.
+ std::unique_lock<std::mutex> imgui_lock(m_imgui_mutex);
+
const AspectMode suggested = g_ActiveConfig.suggested_aspect_mode;
if (suggested == AspectMode::Analog || suggested == AspectMode::AnalogWide)
{