PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Elias Montoya on March 01, 2012, 04:17:54 PM

Title: DPI awareness update
Post by: Elias Montoya on March 01, 2012, 04:17:54 PM

Hello paul, its great to see the progress with the DPI awareness!!. :)

Right now im guessing we will need to replace the coded functions to create fonts and change the setwindowpos api call. Is there something else we will need to do to make the change? Perhaps there is more than that, if you have a list or suggestions, i believe those will be very welcome. :)
Title: Re: DPI awareness update
Post by: José Roca on March 01, 2012, 06:21:50 PM
I must have posted this link a hundred times...

http://msdn.microsoft.com/en-us/library/windows/desktop/dd464660%28v=vs.85%29.aspx

If you want a quick answer... All and every one function that uses physical pixels.
Title: Re: DPI awareness update
Post by: Elias Montoya on March 01, 2012, 07:59:04 PM
 Thanks Jose. :)

Actually, the answer I was just trying to get was specifically related to firefly. For example, will i need to change my code for applications that use FF_Control_SetLoc? Asking paul is the best way to know. :)
Title: Re: DPI awareness update
Post by: Paul Squires on March 01, 2012, 10:35:47 PM
I will have to look at the FireFly Functions to ensure that they are all High DPI aware. Haven't gotten that far yet.
Title: Re: DPI awareness update
Post by: José Roca on March 01, 2012, 11:14:10 PM
Quote
I will have to look at the FireFly Functions to ensure that they are all High DPI aware. Haven't gotten that far yet.

You SHOULD NOT, unless you do it by adding two optional parametes at the end, e.g. rx and ry, to pass the ratios, or dpiX and dpiY to pass the DPIs, that currently are the same but in a future could be different.
Title: Re: DPI awareness update
Post by: Elias Montoya on March 02, 2012, 12:36:55 AM
 I think it would be easier to modify those functions to do the conversions internally (possibly by making a call to your class functions instead of api calls). That way no special modifications are required? So, why not Jose?
Title: Re: DPI awareness update
Post by: José Roca on March 02, 2012, 12:52:34 AM
If it was done automatically, other that destroying a feature of CWindow that allows to change the aspect ratio, what will happen if, for example, you need to use an absolute position, such 1, 1, regardless of te DPI being used? And what will happen if you pass values returmed by a function that has already scaled them?

If you don't want to learn all that it is involved, just don't change anything, run it in virtualized mode and forget that DPI exists.
Title: Re: DPI awareness update
Post by: Elias Montoya on March 02, 2012, 01:15:16 AM

Sometimes i wish they made a completely new OS from scratch. :)
Title: Re: DPI awareness update
Post by: Rolf Brandt on March 02, 2012, 01:28:25 AM
QuoteSometimes i wish they made a completely new OS from scratch.

Amen to that!

Rolf
Title: Re: DPI awareness update
Post by: Eddy Van Esch on March 02, 2012, 05:16:20 AM
Quote from: Elias Montoya on March 02, 2012, 01:15:16 AM
Sometimes i wish they made a completely new OS from scratch. :)
I am hoping that ReactOS matures fast ....
Windows will get worse and worse ... Look at the way they are going with Windows 8 ....  >:(  :'(
Title: Re: DPI awareness update
Post by: José Roca on March 02, 2012, 06:31:17 AM
High DPI is not a Windows problem. Is the price to pay for having high resolution LCD monitors.
Title: Re: DPI awareness update
Post by: Elias Montoya on March 02, 2012, 02:36:12 PM
Quote from: Jose Roca on March 02, 2012, 06:31:17 AM
High DPI is not a Windows problem. Is the price to pay for having high resolution LCD monitors.

True, but its a price we have to pay in "windows cash" in the "windows world". the bad organization of API's returning non DPI resolutions and coordinates in a DPI OS, is a windows problem. I mean, if they are going this way, why not correctling the full api? Answer: because its impossible to know what coordinates have already been processed.

Added:
In a OS from scratch that problem could be easily solved by always working with pixels, except when positioning, sizing or creating objects like fonts to be displayed visually. Even sizes could be retrieved in normal pixels.

Title: Re: DPI awareness update
Post by: José Roca on March 03, 2012, 04:51:56 AM
Quote
In a OS from scratch that problem could be easily solved by always working with pixels, except when positioning, sizing or creating objects like fonts to be displayed visually. Even sizes could be retrieved in normal pixels.

This is what Vista/Windows 7 virtualization do. If you like the results, you have it easy: as I said "just don't change anything, run it in virtualized mode and forget that DPI exists."
Title: Re: DPI awareness update
Post by: Elias Montoya on March 04, 2012, 01:53:02 AM

Doesn't it stretches stuff instead of redimensioning it?
Title: Re: DPI awareness update
Post by: José Roca on March 04, 2012, 05:02:56 AM
Quote
Windows first renders the entire application window to an internal bitmap using 96 DPI sizes, and then scales up that bitmap to the current DPI setting before putting it on the screen.

http://www.kynosarges.de/WindowsDpi.html