summaryrefslogtreecommitdiffhomepage
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/app.cpp3
-rw-r--r--editor/app.hpp3
-rw-r--r--editor/dpi.cpp13
3 files changed, 19 insertions, 0 deletions
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<key, key_COUNT>;
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 <windows.h>
+
+namespace floormat {
+
+void app::set_dpi_aware()
+{
+ SetProcessDPIAware();
+}
+
+} // namespace floormat
+#endif