Demonstrate creating a window covering the entire screen/viewport
| 7131 | |
| 7132 | // Demonstrate creating a window covering the entire screen/viewport |
| 7133 | static void ShowExampleAppFullscreen(bool* p_open) |
| 7134 | { |
| 7135 | static bool use_work_area = true; |
| 7136 | static ImGuiWindowFlags flags = ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings; |
| 7137 | |
| 7138 | // We demonstrate using the full viewport area or the work area (without menu-bars, task-bars etc.) |
| 7139 | // Based on your use case you may want one of the other. |
| 7140 | const ImGuiViewport* viewport = ImGui::GetMainViewport(); |
| 7141 | ImGui::SetNextWindowPos(use_work_area ? viewport->WorkPos : viewport->Pos); |
| 7142 | ImGui::SetNextWindowSize(use_work_area ? viewport->WorkSize : viewport->Size); |
| 7143 | |
| 7144 | if (ImGui::Begin("Example: Fullscreen window", p_open, flags)) |
| 7145 | { |
| 7146 | ImGui::Checkbox("Use work area instead of main area", &use_work_area); |
| 7147 | ImGui::SameLine(); |
| 7148 | 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."); |
| 7149 | |
| 7150 | ImGui::CheckboxFlags("ImGuiWindowFlags_NoBackground", &flags, ImGuiWindowFlags_NoBackground); |
| 7151 | ImGui::CheckboxFlags("ImGuiWindowFlags_NoDecoration", &flags, ImGuiWindowFlags_NoDecoration); |
| 7152 | ImGui::Indent(); |
| 7153 | ImGui::CheckboxFlags("ImGuiWindowFlags_NoTitleBar", &flags, ImGuiWindowFlags_NoTitleBar); |
| 7154 | ImGui::CheckboxFlags("ImGuiWindowFlags_NoCollapse", &flags, ImGuiWindowFlags_NoCollapse); |
| 7155 | ImGui::CheckboxFlags("ImGuiWindowFlags_NoScrollbar", &flags, ImGuiWindowFlags_NoScrollbar); |
| 7156 | ImGui::Unindent(); |
| 7157 | |
| 7158 | if (p_open && ImGui::Button("Close this window")) |
| 7159 | *p_open = false; |
| 7160 | } |
| 7161 | ImGui::End(); |
| 7162 | } |
| 7163 | |
| 7164 | //----------------------------------------------------------------------------- |
| 7165 | // [SECTION] Example App: Manipulating Window Titles / ShowExampleAppWindowTitles() |
no test coverage detected