MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / ShowDemoWindow

Method ShowDemoWindow

3rdparty/imgui/src/imgui_demo.cpp:342–659  ·  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

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

Callers

nothing calls this directly

Calls 15

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

Tested by

no test coverage detected