game_window: respect per-monitor DPI scale

Co-Authored-By: Darío <538504+DarioSamo@users.noreply.github.com>
This commit is contained in:
Hyper 2025-02-07 10:11:06 +00:00
parent 871515b3be
commit 71bb081645
2 changed files with 8 additions and 6 deletions

View file

@ -351,10 +351,12 @@ file(CHMOD ${DIRECTX_DXC_TOOL} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE)
if (WIN32)
target_link_libraries(UnleashedRecomp PRIVATE
comctl32
ntdll
winmm
comctl32
dwmapi
ntdll
Shcore
Synchronization
winmm
)
endif()

View file

@ -9,7 +9,7 @@
#if _WIN32
#include <dwmapi.h>
#pragma comment(lib, "dwmapi.lib")
#include <shellscalingapi.h>
#endif
#include <res/images/game_icon.bmp.h>
@ -184,7 +184,7 @@ void GameWindow::Init(const char* sdlVideoDriver)
SDL_AddEventWatch(Window_OnSDLEvent, s_pWindow);
#ifdef _WIN32
SetProcessDPIAware();
SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);
#endif
Config::WindowSize.LockCallback = [](ConfigDef<int32_t>* def)
@ -442,7 +442,7 @@ void GameWindow::ResetDimensions()
uint32_t GameWindow::GetWindowFlags()
{
uint32_t flags = SDL_WINDOW_HIDDEN | SDL_WINDOW_RESIZABLE;
uint32_t flags = SDL_WINDOW_HIDDEN | SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI;
if (Config::WindowState == EWindowState::Maximised)
flags |= SDL_WINDOW_MAXIMIZED;