mirror of
				https://github.com/Drezil/imgui.git
				synced 2025-10-31 21:21:06 +01:00 
			
		
		
		
	Demo: Added 'Examples->Fullscreen Window' demo. (#3789) + repack and zero-clear ImDrawData.
This commit is contained in:
		| @@ -63,8 +63,9 @@ Index of this file: | ||||
| // [SECTION] Example App: Long Text / ShowExampleAppLongText() | ||||
| // [SECTION] Example App: Auto Resize / ShowExampleAppAutoResize() | ||||
| // [SECTION] Example App: Constrained Resize / ShowExampleAppConstrainedResize() | ||||
| // [SECTION] Example App: Simple Overlay / ShowExampleAppSimpleOverlay() | ||||
| // [SECTION] Example App: Manipulating Window Titles / ShowExampleAppWindowTitles() | ||||
| // [SECTION] Example App: Simple overlay / ShowExampleAppSimpleOverlay() | ||||
| // [SECTION] Example App: Fullscreen window / ShowExampleAppFullscreen() | ||||
| // [SECTION] Example App: Manipulating window titles / ShowExampleAppWindowTitles() | ||||
| // [SECTION] Example App: Custom Rendering using ImDrawList API / ShowExampleAppCustomRendering() | ||||
| // [SECTION] Example App: Documents Handling / ShowExampleAppDocuments() | ||||
|  | ||||
| @@ -168,6 +169,7 @@ static void ShowExampleAppLongText(bool* p_open); | ||||
| static void ShowExampleAppAutoResize(bool* p_open); | ||||
| static void ShowExampleAppConstrainedResize(bool* p_open); | ||||
| static void ShowExampleAppSimpleOverlay(bool* p_open); | ||||
| static void ShowExampleAppFullscreen(bool* p_open); | ||||
| static void ShowExampleAppWindowTitles(bool* p_open); | ||||
| static void ShowExampleAppCustomRendering(bool* p_open); | ||||
| static void ShowExampleMenuFile(); | ||||
| @@ -259,6 +261,7 @@ void ImGui::ShowDemoWindow(bool* p_open) | ||||
|     static bool show_app_auto_resize = false; | ||||
|     static bool show_app_constrained_resize = false; | ||||
|     static bool show_app_simple_overlay = false; | ||||
|     static bool show_app_fullscreen = false; | ||||
|     static bool show_app_window_titles = false; | ||||
|     static bool show_app_custom_rendering = false; | ||||
|  | ||||
| @@ -273,6 +276,7 @@ void ImGui::ShowDemoWindow(bool* p_open) | ||||
|     if (show_app_auto_resize)         ShowExampleAppAutoResize(&show_app_auto_resize); | ||||
|     if (show_app_constrained_resize)  ShowExampleAppConstrainedResize(&show_app_constrained_resize); | ||||
|     if (show_app_simple_overlay)      ShowExampleAppSimpleOverlay(&show_app_simple_overlay); | ||||
|     if (show_app_fullscreen)          ShowExampleAppFullscreen(&show_app_fullscreen); | ||||
|     if (show_app_window_titles)       ShowExampleAppWindowTitles(&show_app_window_titles); | ||||
|     if (show_app_custom_rendering)    ShowExampleAppCustomRendering(&show_app_custom_rendering); | ||||
|  | ||||
| @@ -354,6 +358,7 @@ void ImGui::ShowDemoWindow(bool* p_open) | ||||
|             ImGui::MenuItem("Auto-resizing window", NULL, &show_app_auto_resize); | ||||
|             ImGui::MenuItem("Constrained-resizing window", NULL, &show_app_constrained_resize); | ||||
|             ImGui::MenuItem("Simple overlay", NULL, &show_app_simple_overlay); | ||||
|             ImGui::MenuItem("Fullscreen window", NULL, &show_app_fullscreen); | ||||
|             ImGui::MenuItem("Manipulating window titles", NULL, &show_app_window_titles); | ||||
|             ImGui::MenuItem("Custom rendering", NULL, &show_app_custom_rendering); | ||||
|             ImGui::MenuItem("Documents", NULL, &show_app_documents); | ||||
| @@ -6971,7 +6976,7 @@ static void ShowExampleAppConstrainedResize(bool* p_open) | ||||
| } | ||||
|  | ||||
| //----------------------------------------------------------------------------- | ||||
| // [SECTION] Example App: Simple Overlay / ShowExampleAppSimpleOverlay() | ||||
| // [SECTION] Example App: Simple overlay / ShowExampleAppSimpleOverlay() | ||||
| //----------------------------------------------------------------------------- | ||||
|  | ||||
| // Demonstrate creating a simple static window with no decoration | ||||
| @@ -7012,6 +7017,30 @@ static void ShowExampleAppSimpleOverlay(bool* p_open) | ||||
|     ImGui::End(); | ||||
| } | ||||
|  | ||||
| //----------------------------------------------------------------------------- | ||||
| // [SECTION] Example App: Fullscreen window / ShowExampleAppFullscreen() | ||||
| //----------------------------------------------------------------------------- | ||||
|  | ||||
| // Demonstrate creating a window covering the entire screen/viewport | ||||
| static void ShowExampleAppFullscreen(bool* p_open) | ||||
| { | ||||
|     ImGuiIO& io = ImGui::GetIO(); | ||||
|     static ImGuiWindowFlags flags = ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings; | ||||
|     ImGui::SetNextWindowPos(ImVec2(0, 0)); | ||||
|     ImGui::SetNextWindowSize(io.DisplaySize); | ||||
|     if (ImGui::Begin("Example: Fullscreen window", p_open, flags)) | ||||
|     { | ||||
|         ImGui::CheckboxFlags("ImGuiWindowFlags_NoBackground", &flags, ImGuiWindowFlags_NoBackground); | ||||
|         ImGui::CheckboxFlags("ImGuiWindowFlags_NoDecoration", &flags, ImGuiWindowFlags_NoDecoration); | ||||
|         ImGui::Indent(); | ||||
|         ImGui::CheckboxFlags("ImGuiWindowFlags_NoTitleBar", &flags, ImGuiWindowFlags_NoTitleBar); | ||||
|         ImGui::CheckboxFlags("ImGuiWindowFlags_NoCollapse", &flags, ImGuiWindowFlags_NoCollapse); | ||||
|         ImGui::CheckboxFlags("ImGuiWindowFlags_NoScrollbar", &flags, ImGuiWindowFlags_NoScrollbar); | ||||
|         ImGui::Unindent(); | ||||
|     } | ||||
|     ImGui::End(); | ||||
| } | ||||
|  | ||||
| //----------------------------------------------------------------------------- | ||||
| // [SECTION] Example App: Manipulating Window Titles / ShowExampleAppWindowTitles() | ||||
| //----------------------------------------------------------------------------- | ||||
|   | ||||
		Reference in New Issue
	
	Block a user