MCPcopy Create free account
hub / github.com/Aegel5/SimpleSwitcher / ShowExampleAppFullscreen

Function ShowExampleAppFullscreen

imgui_tiny_app/imgui/imgui_demo.cpp:10084–10114  ·  view source on GitHub ↗

Demonstrate creating a window covering the entire screen/viewport

Source from the content-addressed store, hash-verified

10082
10083// Demonstrate creating a window covering the entire screen/viewport
10084static void ShowExampleAppFullscreen(bool* p_open)
10085{
10086 static bool use_work_area = true;
10087 static ImGuiWindowFlags flags = ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoSavedSettings;
10088
10089 // We demonstrate using the full viewport area or the work area (without menu-bars, task-bars etc.)
10090 // Based on your use case you may want one or the other.
10091 const ImGuiViewport* viewport = ImGui::GetMainViewport();
10092 ImGui::SetNextWindowPos(use_work_area ? viewport->WorkPos : viewport->Pos);
10093 ImGui::SetNextWindowSize(use_work_area ? viewport->WorkSize : viewport->Size);
10094
10095 if (ImGui::Begin("Example: Fullscreen window", p_open, flags))
10096 {
10097 IMGUI_DEMO_MARKER("Examples/Fullscreen window");
10098 ImGui::Checkbox("Use work area instead of main area", &use_work_area);
10099 ImGui::SameLine();
10100 HelpMarker("Main Area = entire viewport,\nWork Area = entire viewport minus sections used by the main menu bars, task bars etc.\n\nEnable the main-menu bar in Examples menu to see the difference.");
10101
10102 ImGui::CheckboxFlags("ImGuiWindowFlags_NoBackground", &flags, ImGuiWindowFlags_NoBackground);
10103 ImGui::CheckboxFlags("ImGuiWindowFlags_NoDecoration", &flags, ImGuiWindowFlags_NoDecoration);
10104 ImGui::Indent();
10105 ImGui::CheckboxFlags("ImGuiWindowFlags_NoTitleBar", &flags, ImGuiWindowFlags_NoTitleBar);
10106 ImGui::CheckboxFlags("ImGuiWindowFlags_NoCollapse", &flags, ImGuiWindowFlags_NoCollapse);
10107 ImGui::CheckboxFlags("ImGuiWindowFlags_NoScrollbar", &flags, ImGuiWindowFlags_NoScrollbar);
10108 ImGui::Unindent();
10109
10110 if (p_open && ImGui::Button("Close this window"))
10111 *p_open = false;
10112 }
10113 ImGui::End();
10114}
10115
10116//-----------------------------------------------------------------------------
10117// [SECTION] Example App: Manipulating Window Titles / ShowExampleAppWindowTitles()

Callers 1

ShowDemoWindowMethod · 0.85

Calls 2

HelpMarkerFunction · 0.85
UnindentFunction · 0.85

Tested by

no test coverage detected