From fc6b063afe393f0c5510766977d598e6a4b632b0 Mon Sep 17 00:00:00 2001 From: ocornut Date: Mon, 6 Jan 2025 16:18:52 +0100 Subject: [PATCH] TestSuite: amends for latest. --- imgui_test_suite/imgui_tests_viewports.cpp | 1 + imgui_test_suite/imgui_tests_widgets.cpp | 6 +++--- shared/imgui_app.cpp | 19 +++++++++---------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/imgui_test_suite/imgui_tests_viewports.cpp b/imgui_test_suite/imgui_tests_viewports.cpp index 484dead7..eb5f44ea 100644 --- a/imgui_test_suite/imgui_tests_viewports.cpp +++ b/imgui_test_suite/imgui_tests_viewports.cpp @@ -30,6 +30,7 @@ static inline bool operator!=(const ImVec2& lhs, const ImVec2& rhs) { return lhs // - Even if we don't implement the test right away: they allow us to remember edge cases and interesting things to test. // - Even if they will be hard to actually implement/automate, they still allow us to manually check things. //------------------------------------------------------------------------- +// TODO: Run test suite with negative coordinates viewports, as it is a frequent code for issues! // TODO: Tests: Viewport: host A, viewport B over A, make new Modal appears where geometry overlap A -> SHOULD APPEAR OVER B // TODO: Tests: Viewport: host A, viewport B over A, window C with TopMost, move over host A (may be merged) then drag over B -> SHOULD APPEAR OVER B AKA NOT MERGE IN A, OR, UNMERGE FROM A // Actually same test is meaningful even without TopMost flag, since clicking C supposedly should bring it to front, C merged in A and dragging around B should appear over B diff --git a/imgui_test_suite/imgui_tests_widgets.cpp b/imgui_test_suite/imgui_tests_widgets.cpp index 7387c002..d5142253 100644 --- a/imgui_test_suite/imgui_tests_widgets.cpp +++ b/imgui_test_suite/imgui_tests_widgets.cpp @@ -440,7 +440,7 @@ void RegisterTests_Widgets(ImGuiTestEngine* e) for (int data_type = 0; data_type < ImGuiDataType_COUNT; data_type++) { #if IMGUI_VERSION_NUM >= 19094 - if (data_type == ImGuiDataType_Bool) + if (data_type == ImGuiDataType_Bool || data_type == ImGuiDataType_String) continue; #endif size_t data_size = ImGui::DataTypeGetInfo(data_type)->Size; @@ -5285,7 +5285,7 @@ void RegisterTests_Widgets(ImGuiTestEngine* e) for (ImGuiDataType data_type = 0; data_type < ImGuiDataType_COUNT; data_type++) { #if IMGUI_VERSION_NUM >= 19094 - if (data_type == ImGuiDataType_Bool) + if (data_type == ImGuiDataType_Bool || data_type == ImGuiDataType_String) continue; #endif const ImGuiDataTypeInfo* data_type_info = ImGui::DataTypeGetInfo(data_type); @@ -5320,7 +5320,7 @@ void RegisterTests_Widgets(ImGuiTestEngine* e) for (int data_type = 0; data_type < ImGuiDataType_COUNT; data_type++) { #if IMGUI_VERSION_NUM >= 19094 - if (data_type == ImGuiDataType_Bool) + if (data_type == ImGuiDataType_Bool || data_type == ImGuiDataType_String) continue; #endif for (int invert_range = 0; invert_range < 2; invert_range++) diff --git a/shared/imgui_app.cpp b/shared/imgui_app.cpp index aef924bd..c625102c 100644 --- a/shared/imgui_app.cpp +++ b/shared/imgui_app.cpp @@ -55,6 +55,7 @@ Index of this file: // [SECTION] ImGuiApp Implementation: SDL + OpenGL3 // [SECTION] ImGuiApp Implementation: GLFW + OpenGL3 // [SECTION] ImGuiApp Implementation: OpenGL (Shared) +// [SECTION] Mock backend for multi-viewports (Shared): The viewports are not visible */ @@ -120,7 +121,7 @@ bool ImGuiApp_ScreenCaptureFunc(ImGuiID viewport_id, int x, int y, int w, int h, //----------------------------------------------------------------------------- #ifdef IMGUI_HAS_VIEWPORT -static void ImGuiApp_InstalMockViewportsBackend(ImGuiApp*); +static void ImGuiApp_InstallMockViewportsBackend(ImGuiApp*); #endif // Data @@ -135,7 +136,7 @@ static void ImGuiApp_ImplNull_InitBackends(ImGuiApp* app) #ifdef IMGUI_HAS_VIEWPORT ImGuiIO& io = ImGui::GetIO(); if (app->MockViewports && (io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable)) - ImGuiApp_InstalMockViewportsBackend(app); + ImGuiApp_InstallMockViewportsBackend(app); #else IM_UNUSED(app); #endif @@ -348,7 +349,7 @@ static void ImGuiApp_ImplWin32DX11_InitBackends(ImGuiApp* app_opaque) #ifdef IMGUI_HAS_VIEWPORT ImGuiIO& io = ImGui::GetIO(); if (app->MockViewports && (io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable)) - ImGuiApp_InstalMockViewportsBackend(app); + ImGuiApp_InstallMockViewportsBackend(app); #endif } @@ -714,7 +715,7 @@ static void ImGuiApp_ImplSdlGL2_InitBackends(ImGuiApp* app_opaque) #ifdef IMGUI_HAS_VIEWPORT ImGuiIO& io = ImGui::GetIO(); if (app->MockViewports && (io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable)) - ImGuiApp_InstalMockViewportsBackend(app); + ImGuiApp_InstallMockViewportsBackend(app); #endif } @@ -860,7 +861,7 @@ static void ImGuiApp_ImplSdlGL3_InitBackends(ImGuiApp* app_opaque) #ifdef IMGUI_HAS_VIEWPORT ImGuiIO& io = ImGui::GetIO(); if (app->MockViewports && (io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable)) - ImGuiApp_InstalMockViewportsBackend(app); + ImGuiApp_InstallMockViewportsBackend(app); #endif } @@ -1068,7 +1069,7 @@ static void ImGuiApp_ImplGlfw_InitBackends(ImGuiApp* app_opaque) #ifdef IMGUI_HAS_VIEWPORT ImGuiIO& io = ImGui::GetIO(); if (app->MockViewports && (io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable)) - ImGuiApp_InstalMockViewportsBackend(app); + ImGuiApp_InstallMockViewportsBackend(app); #endif } @@ -1200,13 +1201,11 @@ static bool ImGuiApp_ImplGL_CaptureFramebuffer(ImGuiApp* app, ImGuiViewport* vie #endif //----------------------------------------------------------------------------- -// [SECTION] Mock backend for multi-viewports (Shared) -// The viewports are not visible +// [SECTION] Mock backend for multi-viewports (Shared): The viewports are not visible //----------------------------------------------------------------------------- #ifdef IMGUI_HAS_VIEWPORT - // A virtual window struct ImGui_ImplMockViewport_ViewportData { @@ -1239,7 +1238,7 @@ static ImGui_ImplMockViewport_ViewportData* ImGui_ImplNullViewport_FindViewportD } // Mock backend (viewports not visible) -static void ImGuiApp_InstalMockViewportsBackend(ImGuiApp*) +static void ImGuiApp_InstallMockViewportsBackend(ImGuiApp*) { ImGuiIO& io = ImGui::GetIO();