mirror of
https://github.com/libretro/RetroArch.git
synced 2025-04-02 10:51:52 -04:00
(Win32) Set DPI Aware for Windows Vista and higher
This commit is contained in:
parent
4b01483482
commit
a72434e945
1 changed files with 19 additions and 0 deletions
|
@ -37,12 +37,31 @@ static void frontend_win32_init(void *data)
|
|||
{
|
||||
char os_version[PATH_MAX_LENGTH];
|
||||
int major, minor;
|
||||
typedef BOOL (WINAPI *isProcessDPIAwareProc)();
|
||||
typedef BOOL (WINAPI *setProcessDPIAwareProc)();
|
||||
|
||||
(void)data;
|
||||
|
||||
frontend_win32_get_os(os_version, sizeof(os_version), &major, &minor);
|
||||
|
||||
isProcessDPIAwareProc isDPIAwareProc = (isProcessDPIAwareProc)
|
||||
GetProcAddress(GetModuleHandle(TEXT("User32.dll")), "IsProcessDPIAware");
|
||||
|
||||
setProcessDPIAwareProc setDPIAwareProc = (setProcessDPIAwareProc)
|
||||
GetProcAddress(GetModuleHandle(TEXT("User32.dll")), "SetProcessDPIAware");
|
||||
|
||||
if (isDPIAwareProc)
|
||||
{
|
||||
fprintf(stderr, "Is DPI aware...\n");
|
||||
if (!isDPIAwareProc())
|
||||
{
|
||||
if (setDPIAwareProc)
|
||||
{
|
||||
fprintf(stderr, "Set DPI aware.\n");
|
||||
setDPIAwareProc();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const frontend_ctx_driver_t frontend_ctx_win32 = {
|
||||
|
|
Loading…
Add table
Reference in a new issue