diff --git a/.github/ci_vcpkg_package_tests/ci_vcpkg_package_tests_app.cpp b/.github/ci_vcpkg_package_tests/ci_vcpkg_package_tests_app.cpp index 08aeb1c5..2cf42c9e 100644 --- a/.github/ci_vcpkg_package_tests/ci_vcpkg_package_tests_app.cpp +++ b/.github/ci_vcpkg_package_tests/ci_vcpkg_package_tests_app.cpp @@ -63,12 +63,12 @@ int main(int argc, char**argv) try { - runnerParams.backendType = HelloImGui::BackendType::Glfw; + runnerParams.platformBackendType = HelloImGui::PlatformBackendType::Glfw; if (argc == 2 && strcmp(argv[1], "sdl") == 0) - runnerParams.backendType = HelloImGui::BackendType::Sdl; + runnerParams.platformBackendType = HelloImGui::PlatformBackendType::Sdl; - if (runnerParams.backendType == HelloImGui::BackendType::Glfw) + if (runnerParams.platformBackendType == HelloImGui::PlatformBackendType::Glfw) printf("Using GLFW backend\n"); else printf("Using SDL backend\n"); diff --git a/hello_imgui_cmake/overlay_vcpkg/test_vcpkg_himgui/test.cpp b/hello_imgui_cmake/overlay_vcpkg/test_vcpkg_himgui/test.cpp index d571bdb1..ff2b2560 100644 --- a/hello_imgui_cmake/overlay_vcpkg/test_vcpkg_himgui/test.cpp +++ b/hello_imgui_cmake/overlay_vcpkg/test_vcpkg_himgui/test.cpp @@ -4,7 +4,7 @@ int main() { HelloImGui::RunnerParams runnerParams; - runnerParams.backendType = HelloImGui::BackendType::Glfw; // Sdl fails with Vulkan + runnerParams.platformBackendType = HelloImGui::PlatformBackendType::Glfw; // Sdl fails with Vulkan runnerParams.callbacks.ShowGui = []() { #ifdef HELLOIMGUI_HAS_OPENGL ImGui::Text("HELLOIMGUI_HAS_OPENGL"); diff --git a/src/hello_imgui/doc_params.md b/src/hello_imgui/doc_params.md index 0677ff3e..24dd985e 100644 --- a/src/hello_imgui/doc_params.md +++ b/src/hello_imgui/doc_params.md @@ -118,11 +118,10 @@ struct RunnerParams // Options for the renderer backend RendererBackendOptions rendererBackendOptions; - // `backendType`: _enum BackendType, default=PlatformBackendType::FirstAvailable_ + // `platformBackendType`: _enum PlatformBackendType, default=PlatformBackendType::FirstAvailable_ // Select the wanted platform backend type between `Sdl`, `Glfw`. // if `FirstAvailable`, Glfw will be preferred over Sdl when both are available. // Only useful when multiple backend are compiled and available. - // (for compatibility with older versions, you can use BackendType instead of PlatformBackendType) PlatformBackendType platformBackendType = PlatformBackendType::FirstAvailable; // `renderingBackendType`: _enum RenderingBackendType, default=RenderingBackendType::FirstAvailable_ @@ -195,11 +194,6 @@ struct RunnerParams // Set the application refresh rate // (only used on emscripten: 0 stands for "let the app or the browser decide") int emscripten_fps = 0; - - // --------------- Legacy -------------------` -#ifndef HELLOIMGUI_DISABLE_OBSOLETE_BACKEND - PlatformBackendType& backendType = platformBackendType; // a synonym, for backward compatibility -#endif }; ``` @@ -209,7 +203,7 @@ struct RunnerParams ```cpp // You can select the platform backend type (SDL, GLFW) and the rendering backend type -// via RunnerParams.backendType and RunnerParams.renderingBackendType. +// via RunnerParams.platformBackendType and RunnerParams.renderingBackendType. // Platform backend type (SDL, GLFW) // They are listed in the order of preference when FirstAvailable is selected. @@ -220,10 +214,6 @@ enum class PlatformBackendType Sdl, }; -#ifndef HELLOIMGUI_DISABLE_OBSOLETE_BACKEND -using BackendType = PlatformBackendType; // for backward compatibility -#endif - // Rendering backend type (OpenGL3, Metal, Vulkan, DirectX11, DirectX12) // They are listed in the order of preference when FirstAvailable is selected. enum class RendererBackendType diff --git a/src/hello_imgui/doc_params.src.md b/src/hello_imgui/doc_params.src.md index 734861c6..cc273de7 100644 --- a/src/hello_imgui/doc_params.src.md +++ b/src/hello_imgui/doc_params.src.md @@ -28,7 +28,7 @@ See [runner_params.h](https://github.com/pthom/hello_imgui/blob/master/src/hello ```cpp -@import "runner_params.h" {md_id=BackendType} +@import "runner_params.h" {md_id=PlatformBackendType} ``` diff --git a/src/hello_imgui/internal/backend_impls/runner_factory.cpp b/src/hello_imgui/internal/backend_impls/runner_factory.cpp index 50a11f2f..d4572a85 100644 --- a/src/hello_imgui/internal/backend_impls/runner_factory.cpp +++ b/src/hello_imgui/internal/backend_impls/runner_factory.cpp @@ -38,7 +38,7 @@ void ChooseBackendTypesIfSelectedAsFirstAvailable(RunnerParams* runnerParams) std::unique_ptr FactorRunner(RunnerParams& params) { ChooseBackendTypesIfSelectedAsFirstAvailable(¶ms); - if(params.backendType == BackendType::Glfw) + if (params.platformBackendType == PlatformBackendType::Glfw) { #ifdef HELLOIMGUI_USE_GLFW3 return std::make_unique(params); @@ -46,7 +46,7 @@ std::unique_ptr FactorRunner(RunnerParams& params) return nullptr; #endif } - else if (params.backendType == BackendType::Sdl) + else if (params.platformBackendType == PlatformBackendType::Sdl) { #if defined(__EMSCRIPTEN__) return std::make_unique(params); diff --git a/src/hello_imgui/runner_params.h b/src/hello_imgui/runner_params.h index d93c275e..f76199d8 100644 --- a/src/hello_imgui/runner_params.h +++ b/src/hello_imgui/runner_params.h @@ -8,17 +8,15 @@ #include "hello_imgui/dpi_aware.h" #include -// #define HELLOIMGUI_DISABLE_OBSOLETE_BACKEND - namespace HelloImGui { // -------------------------------------------------------------------------------------------------------------------- -// @@md#BackendType +// @@md#PlatformBackendType // You can select the platform backend type (SDL, GLFW) and the rendering backend type -// via RunnerParams.backendType and RunnerParams.renderingBackendType. +// via RunnerParams.platformBackendType and RunnerParams.renderingBackendType. // Platform backend type (SDL, GLFW) // They are listed in the order of preference when FirstAvailable is selected. @@ -29,10 +27,6 @@ enum class PlatformBackendType Sdl, }; -#ifndef HELLOIMGUI_DISABLE_OBSOLETE_BACKEND -using BackendType = PlatformBackendType; // for backward compatibility -#endif - // Rendering backend type (OpenGL3, Metal, Vulkan, DirectX11, DirectX12) // They are listed in the order of preference when FirstAvailable is selected. enum class RendererBackendType @@ -186,11 +180,10 @@ struct RunnerParams // Options for the renderer backend RendererBackendOptions rendererBackendOptions; - // `backendType`: _enum BackendType, default=PlatformBackendType::FirstAvailable_ + // `platformBackendType`: _enum PlatformBackendType, default=PlatformBackendType::FirstAvailable_ // Select the wanted platform backend type between `Sdl`, `Glfw`. // if `FirstAvailable`, Glfw will be preferred over Sdl when both are available. // Only useful when multiple backend are compiled and available. - // (for compatibility with older versions, you can use BackendType instead of PlatformBackendType) PlatformBackendType platformBackendType = PlatformBackendType::FirstAvailable; // `renderingBackendType`: _enum RenderingBackendType, default=RenderingBackendType::FirstAvailable_ @@ -263,11 +256,6 @@ struct RunnerParams // Set the application refresh rate // (only used on emscripten: 0 stands for "let the app or the browser decide") int emscripten_fps = 0; - - // --------------- Legacy -------------------` -#ifndef HELLOIMGUI_DISABLE_OBSOLETE_BACKEND - PlatformBackendType& backendType = platformBackendType; // a synonym, for backward compatibility -#endif }; // @@md