Started work to support per monitor DPI. Using DPI to scale tiles
appropriately. Renamed ntassert to nhassert. (Naming mistake caused by using ntassert at work). Re-ordered a few more includes to get window headers included before nethack headers.
This commit is contained in:
@@ -2,12 +2,12 @@
|
||||
/* Copyright (C) 2018 by Bart House */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#include <process.h>
|
||||
#include "winMS.h"
|
||||
#include "hack.h"
|
||||
#include "win10.h"
|
||||
#include <process.h>
|
||||
#include <VersionHelpers.h>
|
||||
|
||||
#include "hack.h"
|
||||
|
||||
Win10 gWin10 = { 0 };
|
||||
|
||||
void win10_init()
|
||||
@@ -27,6 +27,10 @@ void win10_init()
|
||||
if (gWin10.AreDpiAwarenessContextsEqual == NULL)
|
||||
panic("Unable to get address of AreDpiAwarenessContextsEqual");
|
||||
|
||||
gWin10.GetDpiForWindow = (GetDpiForWindowProc) GetProcAddress(hUser32, "GetDpiForWindow");
|
||||
if (gWin10.GetDpiForWindow == NULL)
|
||||
panic("Unable to get address of GetDpiForWindow");
|
||||
|
||||
FreeLibrary(hUser32);
|
||||
|
||||
gWin10.Valid = TRUE;
|
||||
@@ -35,7 +39,7 @@ void win10_init()
|
||||
if (gWin10.Valid) {
|
||||
if (!gWin10.AreDpiAwarenessContextsEqual(
|
||||
gWin10.GetThreadDpiAwarenessContext(),
|
||||
DPI_AWARENESS_CONTEXT_UNAWARE))
|
||||
DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2))
|
||||
panic("Unexpected DpiAwareness state");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user