From c5bffa9c98c50c0270ee19eb933fa4e133e0f955 Mon Sep 17 00:00:00 2001 From: SweetId <2630750+SweetId@users.noreply.github.com> Date: Fri, 20 Oct 2023 20:29:34 -0400 Subject: [PATCH] update example code --- examples/Demo/main.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/examples/Demo/main.cpp b/examples/Demo/main.cpp index afe62c6..d895677 100644 --- a/examples/Demo/main.cpp +++ b/examples/Demo/main.cpp @@ -64,6 +64,7 @@ int WinMain(int argc, char* argv[]) }); Nz::Imgui::Instance()->Init(window); + ImGui::EnsureContextOnThisThread(); MyImguiWindow mywindow; float val = 0.f; @@ -84,8 +85,21 @@ int WinMain(int argc, char* argv[]) float deltaTime = updateClock.GetElapsedTime().AsSeconds(); Nz::Imgui::Instance()->Update(window, deltaTime); - ImGui::EnsureContextOnThisThread(); + if (ImGui::BeginMainMenuBar()) + { + if (ImGui::BeginMenu("Test")) + { + if (ImGui::MenuItem("Test", "Ctrl+O")) + printf("test\n"); + ImGui::EndMenu(); + } + ImGui::EndMainMenuBar(); + } + if (ImGui::BeginPopupModal("toto")) + { + ImGui::EndPopup(); + } ImGui::Begin("Loop Window"); ImGui::Image(logo.get()); ImGui::ImageButton(logo.get());