Sorry, wrong shortcut.
Looks like the single most crucial point is

setProcessDpiAwareness = (SetProcessDpiAwarenessFunc *)
GetProcAddress(hModuleShore, "SetProcessDpiAwareness");

call. Which produces zero if such function does not exist. This means
runtime check is enough, no conditional compilation is required. Just
as Anna suggested.


On 4 December 2017 at 12:59, michael kapelko <[email protected]> wrote:
> Hi.Looks like
>
> On 3 December 2017 at 16:01, Robert Osfield <[email protected]> wrote:
>> Hi Anna,
>>
>> What about older versions of Windows?
>>
>> What is the harm of the #if (WINVER >= 0x8603)
>>
>> Thanks any clarification you can provide.
>> Robert.
>>
>>
>> On 1 December 2017 at 20:18, Anna Sokol <[email protected]> wrote:
>>> Hi,
>>>
>>> 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.
>>>
>>> Regards,
>>> Anna Sokol
>>>
>>> On Thu, Nov 30, 2017 at 9:17 AM, Robert Osfield <[email protected]>
>>> wrote:
>>>>
>>>> Thanks Bjorn, changes merged and submitted to master :-)
>>>>
>>>> On 30 November 2017 at 13:59, Björn Blissing <[email protected]>
>>>> wrote:
>>>> > Hi,
>>>> >
>>>> > Since Windows Vista the operating system assumes all applications as
>>>> > DPI-unaware, unless stated otherwise. This means that if you have desktop
>>>> > scaling enabled (which is pretty much mandatory if you are running a high
>>>> > resolution screen) you will get incorrect scaling and blurry images.
>>>> >
>>>> > The solution is to declare the application as DPI-aware. This can either
>>>> > be done via the inclusion of a manifest file during compilation or by
>>>> > declaring it inside your application. By doing this you are making a 
>>>> > promise
>>>> > to the operating system that you are handling the scaling instead of the 
>>>> > OS.
>>>> >
>>>> > I have made a modification of the osgViewer::GraphicsWindowWin32
>>>> > constructor to declare the application as DPI-aware per monitor. This
>>>> > guarantees that the operating system will never scale the application.
>>>> >
>>>> > Regretfully the required Windows library call requires Windows 8.1 or
>>>> > later. To be able to detect the correct windows version I had to add a 
>>>> > CMake
>>>> > macro to detect and define the _WIN32_WINNT variable.
>>>> >
>>>> > During this development I also found a redundant definition inside the
>>>> > osgDB/FileUtils.cpp file, which I removed.
>>>> >
>>>> > The resulting commits are sent as the following pull request:
>>>> > https://github.com/openscenegraph/OpenSceneGraph/pull/396
>>>> >
>>>> > Regards,
>>>> > Björn
>>>> >
>>>> > ------------------
>>>> > Read this topic online here:
>>>> > http://forum.openscenegraph.org/viewtopic.php?p=72492#72492
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> > _______________________________________________
>>>> > osg-submissions mailing list
>>>> > [email protected]
>>>> >
>>>> > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>>>> _______________________________________________
>>>> osg-submissions mailing list
>>>> [email protected]
>>>>
>>>> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>>>
>>>
>>>
>>> _______________________________________________
>>> osg-submissions mailing list
>>> [email protected]
>>> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>>>
>> _______________________________________________
>> osg-submissions mailing list
>> [email protected]
>> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to