MCPcopy Create free account
hub / github.com/cinder/Cinder / ShowDemoWindow

Method ShowDemoWindow

src/imgui/imgui_demo.cpp:333–646  ·  view source on GitHub ↗

Demonstrate most Dear ImGui features (this is big function!) You may execute this function to experiment with the UI and understand what it does. You may then search for keywords in the code when you are interested by a specific feature.

Source from the content-addressed store, hash-verified

331// You may execute this function to experiment with the UI and understand what it does.
332// You may then search for keywords in the code when you are interested by a specific feature.
333void ImGui::ShowDemoWindow(bool* p_open)
334{
335 // Exceptionally add an extra assert here for people confused about initial Dear ImGui setup
336 // Most functions would normally just assert/crash if the context is missing.
337 IM_ASSERT(ImGui::GetCurrentContext() != NULL && "Missing Dear ImGui context. Refer to examples app!");
338
339 // Verify ABI compatibility between caller code and compiled version of Dear ImGui. This helps detects some build issues.
340 IMGUI_CHECKVERSION();
341
342 // Stored data
343 static ImGuiDemoWindowData demo_data;
344
345 // Examples Apps (accessible from the "Examples" menu)
346 if (demo_data.ShowMainMenuBar) { ShowExampleAppMainMenuBar(); }
347 if (demo_data.ShowAppDocuments) { ShowExampleAppDocuments(&demo_data.ShowAppDocuments); }
348 if (demo_data.ShowAppAssetsBrowser) { ShowExampleAppAssetsBrowser(&demo_data.ShowAppAssetsBrowser); }
349 if (demo_data.ShowAppConsole) { ShowExampleAppConsole(&demo_data.ShowAppConsole); }
350 if (demo_data.ShowAppCustomRendering) { ShowExampleAppCustomRendering(&demo_data.ShowAppCustomRendering); }
351 if (demo_data.ShowAppLog) { ShowExampleAppLog(&demo_data.ShowAppLog); }
352 if (demo_data.ShowAppLayout) { ShowExampleAppLayout(&demo_data.ShowAppLayout); }
353 if (demo_data.ShowAppPropertyEditor) { ShowExampleAppPropertyEditor(&demo_data.ShowAppPropertyEditor, &demo_data); }
354 if (demo_data.ShowAppSimpleOverlay) { ShowExampleAppSimpleOverlay(&demo_data.ShowAppSimpleOverlay); }
355 if (demo_data.ShowAppAutoResize) { ShowExampleAppAutoResize(&demo_data.ShowAppAutoResize); }
356 if (demo_data.ShowAppConstrainedResize) { ShowExampleAppConstrainedResize(&demo_data.ShowAppConstrainedResize); }
357 if (demo_data.ShowAppFullscreen) { ShowExampleAppFullscreen(&demo_data.ShowAppFullscreen); }
358 if (demo_data.ShowAppLongText) { ShowExampleAppLongText(&demo_data.ShowAppLongText); }
359 if (demo_data.ShowAppWindowTitles) { ShowExampleAppWindowTitles(&demo_data.ShowAppWindowTitles); }
360
361 // Dear ImGui Tools (accessible from the "Tools" menu)
362 if (demo_data.ShowMetrics) { ImGui::ShowMetricsWindow(&demo_data.ShowMetrics); }
363 if (demo_data.ShowDebugLog) { ImGui::ShowDebugLogWindow(&demo_data.ShowDebugLog); }
364 if (demo_data.ShowIDStackTool) { ImGui::ShowIDStackToolWindow(&demo_data.ShowIDStackTool); }
365 if (demo_data.ShowAbout) { ImGui::ShowAboutWindow(&demo_data.ShowAbout); }
366 if (demo_data.ShowStyleEditor)
367 {
368 ImGui::Begin("Dear ImGui Style Editor", &demo_data.ShowStyleEditor);
369 ImGui::ShowStyleEditor();
370 ImGui::End();
371 }
372
373 // Demonstrate the various window flags. Typically you would just use the default!
374 static bool no_titlebar = false;
375 static bool no_scrollbar = false;
376 static bool no_menu = false;
377 static bool no_move = false;
378 static bool no_resize = false;
379 static bool no_collapse = false;
380 static bool no_close = false;
381 static bool no_nav = false;
382 static bool no_background = false;
383 static bool no_bring_to_front = false;
384 static bool unsaved_document = false;
385
386 ImGuiWindowFlags window_flags = 0;
387 if (no_titlebar) window_flags |= ImGuiWindowFlags_NoTitleBar;
388 if (no_scrollbar) window_flags |= ImGuiWindowFlags_NoScrollbar;
389 if (!no_menu) window_flags |= ImGuiWindowFlags_MenuBar;
390 if (no_move) window_flags |= ImGuiWindowFlags_NoMove;

Callers

nothing calls this directly

Calls 15

ShowExampleAppDocumentsFunction · 0.85
ShowExampleAppConsoleFunction · 0.85
ShowExampleAppLogFunction · 0.85
ShowExampleAppLayoutFunction · 0.85
ShowExampleAppAutoResizeFunction · 0.85
ShowExampleAppFullscreenFunction · 0.85

Tested by

no test coverage detected