mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-22 11:57:00 +00:00
Backends: Win32: Cache the result of a windows version check. (#3283)
This is not expected to change while the application is running :)
This commit is contained in:
parent
79fbab543d
commit
6eb66fbef3
@ -417,7 +417,8 @@ void ImGui_ImplWin32_EnableDpiAwareness()
|
|||||||
float ImGui_ImplWin32_GetDpiScaleForMonitor(void* monitor)
|
float ImGui_ImplWin32_GetDpiScaleForMonitor(void* monitor)
|
||||||
{
|
{
|
||||||
UINT xdpi = 96, ydpi = 96;
|
UINT xdpi = 96, ydpi = 96;
|
||||||
if (IsWindows8Point1OrGreater())
|
static BOOL bIsWindows8Point1OrGreater = IsWindows8Point1OrGreater();
|
||||||
|
if (bIsWindows8Point1OrGreater)
|
||||||
{
|
{
|
||||||
static HINSTANCE shcore_dll = ::LoadLibraryA("shcore.dll"); // Reference counted per-process
|
static HINSTANCE shcore_dll = ::LoadLibraryA("shcore.dll"); // Reference counted per-process
|
||||||
if (PFN_GetDpiForMonitor GetDpiForMonitorFn = (PFN_GetDpiForMonitor)::GetProcAddress(shcore_dll, "GetDpiForMonitor"))
|
if (PFN_GetDpiForMonitor GetDpiForMonitorFn = (PFN_GetDpiForMonitor)::GetProcAddress(shcore_dll, "GetDpiForMonitor"))
|
||||||
|
Loading…
Reference in New Issue
Block a user