From 853bbb3752a5fa2f58ef456ffb6e3a552e13cb11 Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Sun, 3 Aug 2025 19:22:36 +0200 Subject: initial commit --- imgui-1.92.1/examples/example_null/main.cpp | 38 +++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 imgui-1.92.1/examples/example_null/main.cpp (limited to 'imgui-1.92.1/examples/example_null/main.cpp') diff --git a/imgui-1.92.1/examples/example_null/main.cpp b/imgui-1.92.1/examples/example_null/main.cpp new file mode 100644 index 0000000..460f33c --- /dev/null +++ b/imgui-1.92.1/examples/example_null/main.cpp @@ -0,0 +1,38 @@ +// dear imgui: "null" example application +// (compile and link imgui, create context, run headless with NO INPUTS, NO GRAPHICS OUTPUT) +// This is useful to test building, but you cannot interact with anything here! +#include "imgui.h" +#include + +int main(int, char**) +{ + IMGUI_CHECKVERSION(); + ImGui::CreateContext(); + ImGuiIO& io = ImGui::GetIO(); + + // Build atlas + //unsigned char* tex_pixels = nullptr; + //int tex_w, tex_h; + //io.Fonts->GetTexDataAsRGBA32(&tex_pixels, &tex_w, &tex_h); + io.BackendFlags |= ImGuiBackendFlags_RendererHasTextures; + + for (int n = 0; n < 20; n++) + { + printf("NewFrame() %d\n", n); + io.DisplaySize = ImVec2(1920, 1080); + io.DeltaTime = 1.0f / 60.0f; + ImGui::NewFrame(); + + static float f = 0.0f; + ImGui::Text("Hello, world!"); + ImGui::SliderFloat("float", &f, 0.0f, 1.0f); + ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / io.Framerate, io.Framerate); + ImGui::ShowDemoWindow(nullptr); + + ImGui::Render(); + } + + printf("DestroyContext()\n"); + ImGui::DestroyContext(); + return 0; +} -- cgit v1.2.3-70-g09d2