so you’d need to use 1440x900 everywhere, EXCEPT when drawing images? Then you have to do some deliberate scaling operation first before drawing the image? That’s horrible!
I was hoping there would be a nice clean, single coordinate system for all where you can draw everything at the native resolution, images included. And only then scale the whole of it down with a single transform
There’s no tutorial needed, because you don’t need to change anything in your code to use higher-res displays. You already are drawing at retina resolution if your window is on a retina screen, but the coord system just isn’t necessarily 1:1 in terms of logical to physical pixels.
so I understand the following (forgive me if they are stupid questions):
for a retina screen I still have to work in a 1440x900 (logical) coordinate system. It’s just that I could choose to draw a line at non-integer coordinates. And if that non-integer coordinate/distance happens to be 0.5 it will translate to a 1 physical pixel distance on a retina screen ?
second, for any image I draw, I need to specify to Juce the scaling somewhere at drawing time. So I need to tell it: this image is really 200 physical pixels wide but please draw it at 100 pixels logical resolution in the 1440x900 coordinate system?
Well, sort of, but that sound like the wrong way of looking at things…
You generally know how big you want the final image to be on your UI, so just draw it to fit in that space. I don’t think it makes much sense to pay much attention to its original resolution, just think in terms of “I want this image to fit within a certain rectangle”, and supply images that are a high enough resolution for them to look good on high-res displays.
one thing that’s still unclear to me: suppose I have a window with a single content component in it. This component is sized at 2880x1440, and bitmaps are drawn on it using their physical (retina-optimized) resolution
then we set a.5 affine transform on that component, so that it will have 1440x900 size after transformation
what happens when that window is rendered on a retina screen? Will it render at 1440x900 and then upscale (with information loss) ? Or will it know that on the retina screen the .5 transform would be canceled by the subsquent upscale, and therefore it should render at 2880x1800 without any down/upscale step inbetween?
Huh? There’s no up or down-scaling involved… I’m not sure why you seem so confused about this, why not just try it and look at the result! Don’t get hung up on these specific numbers and just base your sizes on the screen size.