From 279df6d57ec2d4fd263e8a9360f960ac9ffcaed2 Mon Sep 17 00:00:00 2001 From: Anna Sokol Date: Mon, 4 Dec 2017 13:01:52 +0000 Subject: [PATCH] From Anna Sokol, "There is no need to specify WINVER of 0x0603 in order to check for the SetProcessDPIAwareness function existence. If your current OS where the application is running is Windows 8.1 or above it the function will exist in the dll or if its below it wont. I checked the attached code with both a Windows 7 desktop (where the function doesn't exist) and a Windows 10 tablet (where it does and had my screen scaled to 150%) and in both cases the code worked as intended." --- src/osgViewer/GraphicsWindowWin32.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/osgViewer/GraphicsWindowWin32.cpp b/src/osgViewer/GraphicsWindowWin32.cpp index 6905a8856..c96189518 100644 --- a/src/osgViewer/GraphicsWindowWin32.cpp +++ b/src/osgViewer/GraphicsWindowWin32.cpp @@ -96,9 +96,9 @@ enum tagPOINTER_INPUT_TYPE { PT_TOUCH = 0x00000002, // Touch PT_PEN = 0x00000003, // Pen PT_MOUSE = 0x00000004, // Mouse -#if(WINVER >= 0x0603) +//#if(WINVER >= 0x0603) PT_TOUCHPAD = 0x00000005, // Touchpad -#endif /* WINVER >= 0x0603 */ +//#endif /* WINVER >= 0x0603 */ }; typedef DWORD POINTER_INPUT_TYPE; @@ -145,7 +145,7 @@ static GetTouchInputInfoFunc *getTouchInputInfoFunc = NULL; static GetPointerTypeFunc *getPointerTypeFunc = NULL; // DPI Awareness -#if(WINVER >= 0x0603) +// #if(WINVER >= 0x0603) #ifndef DPI_ENUMS_DECLARED @@ -163,7 +163,7 @@ BOOL PROCESS_DPI_AWARENESS dpi_awareness)); static SetProcessDpiAwarenessFunc *setProcessDpiAwareness = NULL; -#endif +// #endif @@ -787,10 +787,10 @@ Win32WindowingSystem::Win32WindowingSystem() } -#if(WINVER >= 0x0603) - // For Windows 8.1 and higher +// #if(WINVER >= 0x0603) + // For Windows 8.1 and higher // - // Per monitor DPI aware.This app checks for the DPI when it is created and adjusts the scale factor + // Per monitor DPI aware.This app checks for the DPI when it is created and adjusts the scale factor // whenever the DPI changes.These applications are not automatically scaled by the system. HMODULE hModuleShore = LoadLibrary("Shcore"); if (hModuleShore) { @@ -799,7 +799,7 @@ Win32WindowingSystem::Win32WindowingSystem() (*setProcessDpiAwareness)(PROCESS_DPI_AWARENESS::PROCESS_PER_MONITOR_DPI_AWARE); } } -#endif +// #endif } Win32WindowingSystem::~Win32WindowingSystem()