From 373b262c7306436cea54ec7f151cd5a7ca9f0960 Mon Sep 17 00:00:00 2001 From: perroboc <2722773+perroboc@users.noreply.github.com> Date: Tue, 3 Sep 2024 17:39:31 -0400 Subject: [PATCH] FIX: enable HiDPI scaling on linux --- .gitignore | 2 ++ Dev/Cpp/EditorCommon/GUI/MainWindow.cpp | 6 ++++++ Dev/clean.sh | 2 ++ Tool/CMakeLists.txt | 2 +- docs/Development/HowToBuild.md | 2 +- release_tool.sh | 0 6 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 Dev/clean.sh mode change 100644 => 100755 release_tool.sh diff --git a/.gitignore b/.gitignore index 9390825b3f..6721e3cbde 100644 --- a/.gitignore +++ b/.gitignore @@ -60,3 +60,5 @@ mono_crash.*.json mono_crash.*.blob Script/__pycache__/aceutils.cpython-37.pyc Tool/fbxsdk + +EffekseerTool/ \ No newline at end of file diff --git a/Dev/Cpp/EditorCommon/GUI/MainWindow.cpp b/Dev/Cpp/EditorCommon/GUI/MainWindow.cpp index 8f6ad009a5..13ea3e20b7 100644 --- a/Dev/Cpp/EditorCommon/GUI/MainWindow.cpp +++ b/Dev/Cpp/EditorCommon/GUI/MainWindow.cpp @@ -74,6 +74,12 @@ bool MainWindow::InitializeInternal(const char16_t* title, MainWindowState state float yscale = 1.0f; glfwGetMonitorContentScale(primary, &xscale, &yscale); dpiScale_ = xscale; +#elif defined(__linux__) + GLFWmonitor* primary = glfwGetPrimaryMonitor(); + float xscale = 1.0f; + float yscale = 1.0f; + glfwGetMonitorContentScale(primary, &xscale, &yscale); + dpiScale_ = xscale; #endif return true; diff --git a/Dev/clean.sh b/Dev/clean.sh new file mode 100644 index 0000000000..3db10b9a80 --- /dev/null +++ b/Dev/clean.sh @@ -0,0 +1,2 @@ +rm --force release/*.pdb +rm --force release/Effekseer diff --git a/Tool/CMakeLists.txt b/Tool/CMakeLists.txt index 6b4fca33fb..d4e1493907 100644 --- a/Tool/CMakeLists.txt +++ b/Tool/CMakeLists.txt @@ -8,7 +8,7 @@ endif() project(Tools) -set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD 14) if(MSVC) set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") diff --git a/docs/Development/HowToBuild.md b/docs/Development/HowToBuild.md index a5c9f776c1..bef93903e9 100644 --- a/docs/Development/HowToBuild.md +++ b/docs/Development/HowToBuild.md @@ -32,7 +32,7 @@ Requirements - [.Net6.0 SDK](https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu) - Required packages: - - Ubuntu: `libx11-dev libgl1-mesa-dev libxrandr-dev libxi-dev x11proto-xf86vidmode-dev libx11-xcb-dev xorg-dev libglu1-mesa-dev libpulse-dev libgtk-3-dev libopenal-dev python3-distutils zenity` + - Ubuntu: `libglfw3-dev libx11-dev libgl1-mesa-dev libxrandr-dev libxi-dev x11proto-xf86vidmode-dev libx11-xcb-dev xorg-dev libglu1-mesa-dev libpulse-dev libgtk-3-dev libopenal-dev python3-distutils zenity` - On Fedora 40: `gtk3-devel pulseaudio-libs-devel openal-soft-devel mesa-libGLU-devel libX11-devel libxcb-devel libXi-devel libXrandr-devel mesa-libGL-devel glfw-devel gd-devel python3 dotnet zenity` Get code and resources diff --git a/release_tool.sh b/release_tool.sh old mode 100644 new mode 100755