From c1fade6e5b3ca5e625c2874c2fe668a640822326 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 21 Oct 2023 15:49:04 -0700 Subject: [PATCH] apprt/embedded: also must render imgui multiple times --- src/apprt/embedded.zig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/apprt/embedded.zig b/src/apprt/embedded.zig index 8d01db594..6c929b9f5 100644 --- a/src/apprt/embedded.zig +++ b/src/apprt/embedded.zig @@ -919,8 +919,10 @@ pub const Inspector = struct { assert(self.backend == .metal); //log.debug("render", .{}); - // Setup our imgui frame - { + // Setup our imgui frame. We need to render multiple frames to ensure + // ImGui completes all its state processing. I don't know how to fix + // this. + for (0..2) |_| { cimgui.c.ImGui_ImplMetal_NewFrame(desc.value); try self.newFrame(); cimgui.c.igNewFrame();