From aab809fdb952e39282eade8a5f40a4ba4a24ac4e Mon Sep 17 00:00:00 2001 From: Pascal Thomet Date: Fri, 2 Feb 2024 23:53:38 +0100 Subject: [PATCH] if uwp, no ImGui_ImplWin32_EnableDpiAwareness() --- .../backend_window_helper/win32_dpi_awareness.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/hello_imgui/internal/backend_impls/backend_window_helper/win32_dpi_awareness.cpp b/src/hello_imgui/internal/backend_impls/backend_window_helper/win32_dpi_awareness.cpp index ad62928e..0c15f310 100644 --- a/src/hello_imgui/internal/backend_impls/backend_window_helper/win32_dpi_awareness.cpp +++ b/src/hello_imgui/internal/backend_impls/backend_window_helper/win32_dpi_awareness.cpp @@ -1,12 +1,16 @@ #ifdef _WIN32 -#ifdef __cplusplus_winrt +#if WINAPI_FAMILY == WINAPI_FAMILY_APP +#define UWP_DISABLE_DPI_AWARENESS +#endif + +#ifdef UWP_DISABLE_DPI_AWARENESS #include void ImGui_ImplWin32_EnableDpiAwareness() { fprintf(stderr, "ImGui_ImplWin32_EnableDpiAwareness not implemented for __cplusplus_winrt, aka uwp\n"); } -#else // __cplusplus_winrt +#else // UWP_DISABLE_DPI_AWARENESS // Adapted from imgui/backends/imgui_impl_win32.cpp #include "imgui.h" @@ -178,6 +182,6 @@ namespace Internal } // namespace Internal } // namespace HelloImGui -#endif // __cplusplus_winrt +#endif // UWP_DISABLE_DPI_AWARENESS #endif // #ifdef _WIN32