MCPcopy Create free account
hub / github.com/GPUOpen-LibrariesAndSDKs/Cauldron / ShowExampleAppLog

Function ShowExampleAppLog

libs/imgui/imgui_demo.cpp:2872–2887  ·  view source on GitHub ↗

Demonstrate creating a simple log window with basic filtering.

Source from the content-addressed store, hash-verified

2870
2871// Demonstrate creating a simple log window with basic filtering.
2872static void ShowExampleAppLog(bool* p_open)
2873{
2874 static ExampleAppLog log;
2875
2876 // Demo: add random items (unless Ctrl is held)
2877 static float last_time = -1.0f;
2878 float time = ImGui::GetTime();
2879 if (time - last_time >= 0.20f && !ImGui::GetIO().KeyCtrl)
2880 {
2881 const char* random_words[] = { "system", "info", "warning", "error", "fatal", "notice", "log" };
2882 log.AddLog("[%s] Hello, time is %.1f, frame count is %d\n", random_words[rand() % IM_ARRAYSIZE(random_words)], time, ImGui::GetFrameCount());
2883 last_time = time;
2884 }
2885
2886 log.Draw("Example: Log", p_open);
2887}
2888
2889// Demonstrate create a window with multiple child windows.
2890static void ShowExampleAppLayout(bool* p_open)

Callers 1

ShowDemoWindowMethod · 0.85

Calls 1

DrawMethod · 0.45

Tested by

no test coverage detected