From 0fa4a8542bf9eda8bd9c28da199b3e90e04279b9 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 22 Nov 2022 03:19:29 +0100 Subject: wip --- editor/app.cpp | 3 +++ editor/app.hpp | 3 +++ editor/dpi.cpp | 13 +++++++++++++ 3 files changed, 19 insertions(+) create mode 100644 editor/dpi.cpp (limited to 'editor') diff --git a/editor/app.cpp b/editor/app.cpp index 85bbba54..75895ec2 100644 --- a/editor/app.cpp +++ b/editor/app.cpp @@ -120,6 +120,9 @@ int app::run_from_argv(const int argc, const char* const* const argv) int main(int argc, char** argv) { +#ifdef _WIN32 + floormat::app::set_dpi_aware(); +#endif return floormat::app::run_from_argv(argc, argv); } diff --git a/editor/app.hpp b/editor/app.hpp index 57487b01..a1b135e0 100644 --- a/editor/app.hpp +++ b/editor/app.hpp @@ -36,6 +36,9 @@ struct app final : floormat_app static int run_from_argv(int argc, const char* const* argv); static fm_settings parse_cmdline(int argc, const char* const* argv); ~app() override; +#ifdef _WIN32 + static void set_dpi_aware(); +#endif private: using key_set = enum_bitset; diff --git a/editor/dpi.cpp b/editor/dpi.cpp new file mode 100644 index 00000000..5893ac96 --- /dev/null +++ b/editor/dpi.cpp @@ -0,0 +1,13 @@ +#ifdef _WIN32 +#include "app.hpp" +#include + +namespace floormat { + +void app::set_dpi_aware() +{ + SetProcessDPIAware(); +} + +} // namespace floormat +#endif -- cgit v1.2.3