The problem of getting the version at compile time is that it breaks
cross-compilation, where the value is set to "".

Maybe a better solution is to explicitly specify the target version of
windows instead of taking the one of the build system.

Alberto

Robert Osfield writes:

> Thanks Anna (and Michael for the explanation), changes now merged with
> OSG master.
>
> On 1 December 2017 at 20:18, Anna Sokol <annaso...@gmail.com> 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 <robert.osfi...@gmail.com>
>> wrote:
>>>
>>> Thanks Bjorn, changes merged and submitted to master :-)
>>>
>>> On 30 November 2017 at 13:59, Björn Blissing <bjorn.bliss...@vti.se>
>>> 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
>>> > osg-submissions@lists.openscenegraph.org
>>> >
>>> > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>>> _______________________________________________
>>> osg-submissions mailing list
>>> osg-submissions@lists.openscenegraph.org
>>>
>>> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>>
>>
>>
>> _______________________________________________
>> osg-submissions mailing list
>> osg-submissions@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>>
> _______________________________________________
> osg-submissions mailing list
> osg-submissions@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

-- 
Alberto

_______________________________________________
osg-submissions mailing list
osg-submissions@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to