mirror of
https://github.com/libretro/RetroArch
synced 2025-02-21 18:40:09 +00:00
(Win32) Set DPI Aware for Windows Vista and higher
This commit is contained in:
parent
4b01483482
commit
a72434e945
@ -37,12 +37,31 @@ static void frontend_win32_init(void *data)
|
|||||||
{
|
{
|
||||||
char os_version[PATH_MAX_LENGTH];
|
char os_version[PATH_MAX_LENGTH];
|
||||||
int major, minor;
|
int major, minor;
|
||||||
|
typedef BOOL (WINAPI *isProcessDPIAwareProc)();
|
||||||
|
typedef BOOL (WINAPI *setProcessDPIAwareProc)();
|
||||||
|
|
||||||
(void)data;
|
(void)data;
|
||||||
|
|
||||||
frontend_win32_get_os(os_version, sizeof(os_version), &major, &minor);
|
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 = {
|
const frontend_ctx_driver_t frontend_ctx_win32 = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user