mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
RenderWidget: Hook up to ImGui
This commit is contained in:
@ -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)
|
||||
{
|
||||
|
@ -188,6 +188,11 @@ public:
|
||||
|
||||
virtual std::unique_ptr<VideoCommon::AsyncShaderCompiler> CreateAsyncShaderCompiler();
|
||||
|
||||
// Returns a lock for the ImGui mutex, enabling data structures to be modified from outside.
|
||||
// Use with care, only non-drawing functions should be called from outside the video thread,
|
||||
// as the drawing is tied to a "frame".
|
||||
std::unique_lock<std::mutex> GetImGuiLock();
|
||||
|
||||
protected:
|
||||
std::tuple<int, int> CalculateTargetScale(int x, int y) const;
|
||||
bool CalculateTargetSize();
|
||||
@ -243,6 +248,7 @@ protected:
|
||||
std::unique_ptr<NativeVertexFormat> m_imgui_vertex_format;
|
||||
std::vector<std::unique_ptr<AbstractTexture>> m_imgui_textures;
|
||||
std::unique_ptr<AbstractPipeline> m_imgui_pipeline;
|
||||
std::mutex m_imgui_mutex;
|
||||
u64 m_imgui_last_frame_time;
|
||||
|
||||
private:
|
||||
|
Reference in New Issue
Block a user