From c843d5c57f494432135c992724a74f67e5a60c6f Mon Sep 17 00:00:00 2001 From: Pascal Thomet Date: Tue, 6 Feb 2024 09:20:01 +0100 Subject: [PATCH] dpi_aware: do not store pref in app ini file --- src/hello_imgui/doc_params.md | 12 ++++++------ src/hello_imgui/dpi_aware.h | 5 ++--- .../internal/backend_impls/abstract_runner.cpp | 9 +++++---- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/hello_imgui/doc_params.md b/src/hello_imgui/doc_params.md index 6a84d7cf..ef6c0b92 100644 --- a/src/hello_imgui/doc_params.md +++ b/src/hello_imgui/doc_params.md @@ -114,6 +114,10 @@ struct RunnerParams // These pointers will be filled when the application starts BackendPointers backendPointers; + // `rendererBackendOptions`: _see renderer_backend_options.h_ + // Options for the renderer backend + RendererBackendOptions rendererBackendOptions; + // `backendType`: _enum BackendType, default=PlatformBackendType::FirstAvailable_ // Select the wanted platform backend type between `Sdl`, `Glfw`. // if `FirstAvailable`, Glfw will be preferred over Sdl when both are available. @@ -127,9 +131,6 @@ struct RunnerParams // Only useful when multiple rendering backend are compiled and available. RendererBackendType rendererBackendType = RendererBackendType::FirstAvailable; - // `rendererBackendOptions`: _see renderer_backend_options.h_ - // Options for the renderer backend - RendererBackendOptions rendererBackendOptions; // --------------- Settings ------------------- @@ -852,10 +853,9 @@ See [dpi_aware.h](ttps://github.com/pthom/hello_imgui/blob/master/src/hello_imgu // you may set them manually: // (1) Either by setting them programmatically in your application // (set their values in `runnerParams.dpiAwareParams`) -// (2) Either by setting them in the app ini file -// (3) Either by setting them in a `hello_imgui.ini` file in the current folder, or any of its parent folders. +// (2) Either by setting them in a `hello_imgui.ini` file in the current folder, or any of its parent folders. // (this is useful when you want to set them for a specific app or set of apps, without modifying the app code) -// Note: if several methods are used, the order of priority is (1) > (2) > (3) +// Note: if several methods are used, the order of priority is (1) > (2) // // Example content of a ini file: // ------------------------------ diff --git a/src/hello_imgui/dpi_aware.h b/src/hello_imgui/dpi_aware.h index 82c6669a..cd48d60a 100644 --- a/src/hello_imgui/dpi_aware.h +++ b/src/hello_imgui/dpi_aware.h @@ -25,10 +25,9 @@ namespace HelloImGui // you may set them manually: // (1) Either by setting them programmatically in your application // (set their values in `runnerParams.dpiAwareParams`) -// (2) Either by setting them in the app ini file -// (3) Either by setting them in a `hello_imgui.ini` file in the current folder, or any of its parent folders. +// (2) Either by setting them in a `hello_imgui.ini` file in the current folder, or any of its parent folders. // (this is useful when you want to set them for a specific app or set of apps, without modifying the app code) -// Note: if several methods are used, the order of priority is (1) > (2) > (3) +// Note: if several methods are used, the order of priority is (1) > (2) // // Example content of a ini file: // ------------------------------ diff --git a/src/hello_imgui/internal/backend_impls/abstract_runner.cpp b/src/hello_imgui/internal/backend_impls/abstract_runner.cpp index 4ab09497..3e91e0f8 100644 --- a/src/hello_imgui/internal/backend_impls/abstract_runner.cpp +++ b/src/hello_imgui/internal/backend_impls/abstract_runner.cpp @@ -201,10 +201,9 @@ void ReadDpiAwareParams(const std::string& appIniSettingLocation, DpiAwareParams // you may set them manually: // (1) Either by setting them programmatically in your application // (set their values in `runnerParams.dpiAwareParams`) - // (2) Either by setting them in the app ini file - // (3) Either by setting them in a `hello_imgui.ini` file in the current folder, or any of its parent folders. + // (2) Either by setting them in a `hello_imgui.ini` file in the current folder, or any of its parent folders. // (this is useful when you want to set them for a specific app or set of apps, without modifying the app code) - // Note: if several methods are used, the order of priority is (1) > (2) > (3) + // Note: if several methods are used, the order of priority is (1) > (2) // // Example content of a ini file: // ------------------------------ @@ -259,7 +258,9 @@ void ReadDpiAwareParams(const std::string& appIniSettingLocation, DpiAwareParams auto allIniFilesToSearch = [&]() -> std::vector { std::vector allIniFileToSearch; - allIniFileToSearch.push_back(appIniSettingLocation); + + //allIniFileToSearch.push_back(appIniSettingLocation); + (void)appIniSettingLocation; std::string currentFolder = std::filesystem::current_path().string(); for (const auto& folder: folderAndAllParents(currentFolder))