From c58e26b04cfb5d674dd350b5b70501aa25731e46 Mon Sep 17 00:00:00 2001 From: Nathan Date: Thu, 3 Apr 2025 15:52:54 -0500 Subject: [PATCH] add a new window to TestImgui --- .../GuiModules/TestImgui/src/TestImgui.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/modules/examples/GuiModules/TestImgui/src/TestImgui.cpp b/modules/examples/GuiModules/TestImgui/src/TestImgui.cpp index 163005e..2b21e6b 100644 --- a/modules/examples/GuiModules/TestImgui/src/TestImgui.cpp +++ b/modules/examples/GuiModules/TestImgui/src/TestImgui.cpp @@ -81,5 +81,24 @@ void TestImgui::run() { else app->end(); + { + ImGuiIO& io = ImGui::GetIO(); + static float f = 0.0f; + static int counter = 0; + + ImGui::Begin("Hello, world!"); // Create a window called "Hello, world!" and append into it. + + ImGui::Text("This is some useful text."); // Display some text (you can use a format strings too) + + ImGui::SliderFloat("float", &f, 0.0f, 1.0f); // Edit 1 float using a slider from 0.0f to 1.0f + + if (ImGui::Button("Button")) // Buttons return true when clicked (most widgets return true when edited/activated) + counter++; + ImGui::SameLine(); + ImGui::Text("counter = %d", counter); + + ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / io.Framerate, io.Framerate); + ImGui::End(); + } ImGui::Render(); }