MCPcopy Create free account
hub / github.com/VictorGordan/opengl-tutorials / ShowDemoWindow

Method ShowDemoWindow

ImGUI GLFW Tutorial/imgui/imgui_demo.cpp:258–526  ·  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

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

Callers

nothing calls this directly

Calls 15

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