MCPcopy Create free account
hub / github.com/DISTRHO/Cardinal / ShowExampleAppFullscreen

Function ShowExampleAppFullscreen

plugins/Cardinal/src/DearImGui/imgui_demo.cpp:7250–7279  ·  view source on GitHub ↗

Demonstrate creating a window covering the entire screen/viewport

Source from the content-addressed store, hash-verified

7248
7249// Demonstrate creating a window covering the entire screen/viewport
7250static void ShowExampleAppFullscreen(bool* p_open)
7251{
7252 static bool use_work_area = true;
7253 static ImGuiWindowFlags flags = ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings;
7254
7255 // We demonstrate using the full viewport area or the work area (without menu-bars, task-bars etc.)
7256 // Based on your use case you may want one of the other.
7257 const ImGuiViewport* viewport = ImGui::GetMainViewport();
7258 ImGui::SetNextWindowPos(use_work_area ? viewport->WorkPos : viewport->Pos);
7259 ImGui::SetNextWindowSize(use_work_area ? viewport->WorkSize : viewport->Size);
7260
7261 if (ImGui::Begin("Example: Fullscreen window", p_open, flags))
7262 {
7263 ImGui::Checkbox("Use work area instead of main area", &use_work_area);
7264 ImGui::SameLine();
7265 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.");
7266
7267 ImGui::CheckboxFlags("ImGuiWindowFlags_NoBackground", &flags, ImGuiWindowFlags_NoBackground);
7268 ImGui::CheckboxFlags("ImGuiWindowFlags_NoDecoration", &flags, ImGuiWindowFlags_NoDecoration);
7269 ImGui::Indent();
7270 ImGui::CheckboxFlags("ImGuiWindowFlags_NoTitleBar", &flags, ImGuiWindowFlags_NoTitleBar);
7271 ImGui::CheckboxFlags("ImGuiWindowFlags_NoCollapse", &flags, ImGuiWindowFlags_NoCollapse);
7272 ImGui::CheckboxFlags("ImGuiWindowFlags_NoScrollbar", &flags, ImGuiWindowFlags_NoScrollbar);
7273 ImGui::Unindent();
7274
7275 if (p_open && ImGui::Button("Close this window"))
7276 *p_open = false;
7277 }
7278 ImGui::End();
7279}
7280
7281//-----------------------------------------------------------------------------
7282// [SECTION] Example App: Manipulating Window Titles / ShowExampleAppWindowTitles()

Callers 1

ShowDemoWindowMethod · 0.85

Calls 2

HelpMarkerFunction · 0.85
ButtonClass · 0.85

Tested by

no test coverage detected