MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / ShowDemoWindow

Method ShowDemoWindow

extern/imgui/imgui_demo.cpp:259–602  ·  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

257// You may execute this function to experiment with the UI and understand what it does.
258// You may then search for keywords in the code when you are interested by a specific feature.
259void ImGui::ShowDemoWindow(bool* p_open)
260{
261 // Exceptionally add an extra assert here for people confused about initial Dear ImGui setup
262 // Most functions would normally just crash if the context is missing.
263 IM_ASSERT(ImGui::GetCurrentContext() != NULL && "Missing dear imgui context. Refer to examples app!");
264
265 // Examples Apps (accessible from the "Examples" menu)
266 static bool show_app_main_menu_bar = false;
267 static bool show_app_dockspace = false;
268 static bool show_app_documents = false;
269 static bool show_app_console = false;
270 static bool show_app_log = false;
271 static bool show_app_layout = false;
272 static bool show_app_property_editor = false;
273 static bool show_app_long_text = false;
274 static bool show_app_auto_resize = false;
275 static bool show_app_constrained_resize = false;
276 static bool show_app_simple_overlay = false;
277 static bool show_app_fullscreen = false;
278 static bool show_app_window_titles = false;
279 static bool show_app_custom_rendering = false;
280
281 if (show_app_main_menu_bar) ShowExampleAppMainMenuBar();
282 if (show_app_dockspace) ShowExampleAppDockSpace(&show_app_dockspace); // Process the Docking app first, as explicit DockSpace() nodes needs to be submitted early (read comments near the DockSpace function)
283 if (show_app_documents) ShowExampleAppDocuments(&show_app_documents); // Process the Document app next, as it may also use a DockSpace()
284 if (show_app_console) ShowExampleAppConsole(&show_app_console);
285 if (show_app_log) ShowExampleAppLog(&show_app_log);
286 if (show_app_layout) ShowExampleAppLayout(&show_app_layout);
287 if (show_app_property_editor) ShowExampleAppPropertyEditor(&show_app_property_editor);
288 if (show_app_long_text) ShowExampleAppLongText(&show_app_long_text);
289 if (show_app_auto_resize) ShowExampleAppAutoResize(&show_app_auto_resize);
290 if (show_app_constrained_resize) ShowExampleAppConstrainedResize(&show_app_constrained_resize);
291 if (show_app_simple_overlay) ShowExampleAppSimpleOverlay(&show_app_simple_overlay);
292 if (show_app_fullscreen) ShowExampleAppFullscreen(&show_app_fullscreen);
293 if (show_app_window_titles) ShowExampleAppWindowTitles(&show_app_window_titles);
294 if (show_app_custom_rendering) ShowExampleAppCustomRendering(&show_app_custom_rendering);
295
296 // Dear ImGui Tools/Apps (accessible from the "Tools" menu)
297 static bool show_app_metrics = false;
298 static bool show_app_debug_log = false;
299 static bool show_app_stack_tool = false;
300 static bool show_app_about = false;
301 static bool show_app_style_editor = false;
302
303 if (show_app_metrics)
304 ImGui::ShowMetricsWindow(&show_app_metrics);
305 if (show_app_debug_log)
306 ImGui::ShowDebugLogWindow(&show_app_debug_log);
307 if (show_app_stack_tool)
308 ImGui::ShowStackToolWindow(&show_app_stack_tool);
309 if (show_app_about)
310 ImGui::ShowAboutWindow(&show_app_about);
311 if (show_app_style_editor)
312 {
313 ImGui::Begin("Dear ImGui Style Editor", &show_app_style_editor);
314 ImGui::ShowStyleEditor();
315 ImGui::End();
316 }

Callers

nothing calls this directly

Calls 15

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

Tested by

no test coverage detected