Skip to content

Commit

Permalink
DPI aware on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
CodingJellyfish committed Oct 24, 2024
1 parent ac37659 commit 4b534d4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,10 @@ if(MSVC OR MINGW)
add_custom_target(stkshaders SOURCES ${STK_SHADERS})
endif()

if(MSVC OR MINGW)
target_sources(supertuxkart PRIVATE windows/windows_config.rc)
endif()

if(MINGW)
target_link_libraries(supertuxkart -ldxguid -ldnsapi)
if (NOT CMAKE_BUILD_TYPE MATCHES Debug)
Expand Down
13 changes: 13 additions & 0 deletions windows/dpi_aware.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<assemblyIdentity type="win32" name="MyApplication" version="1.0.0.0" processorArchitecture="amd64"/>

<asmv3:application>
<asmv3:windowsSettings>
<!-- fallback for Windows 7 and 8 -->
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/pm</dpiAware>
<!-- adding v1 as fallback would result in v2 not being applied to dialogs on capable systems -->
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2,permonitor</dpiAwareness>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>
3 changes: 3 additions & 0 deletions windows/windows_config.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include "winuser.h"

CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "dpi_aware.manifest"

0 comments on commit 4b534d4

Please sign in to comment.