Does anyone have an example of how to correctly setup an openFrameworks app to run on a Retina display Mac?
I’m running on a 2019 MacBook Air which has a screen resolution of 2560x1600, and I have scaling set to ‘default’ which results in openFrameworks giving me a screen size of 1440x900, so the scale factor is a somewhat painful 1.77777777.
I tried the other scaling options including a 1280x800 one which would have had a nice 2.0 scale factor but still no joy.
Tried with ‘High Resolution Capable’ in the .plist set to YES and NO, always the same.
One unexpected thing I spotted was that it is not just the contents of the window getting scaled( which I expected) but also the window title bar and contents, here is a screenshot of a terminal window on top of the openFrameworks app with Xcode in the background:
That should work right out of the box.
Can you try with the latest nightly build instead? You can download at openframeworks.cc/download/ just scroll down a bit.
I am on mojave as well and I have no troubles with retina res, yet I am using the development master branch, which should be the same as the nightly build.
About the window decoration, I would think that it is handled by the OS, yet you can also see that issue when you use a system dialog, as when you call ofSystemLoadDialog(); no idea why it is like this.
I’ve measured the window size according to other apps running on the system and it appears the windows size I’m getting back from ofGetWindowHeight/Width() is matching the correctly scaled size in other apps multiplied by the getPixelScreenCoordScale which for some reason is being returned as 2, and the windows decoration too is looking clean and crisp like just like other native windows.
Stretching the window to full width or setting to full screen I see a size of 2880x1800, which is exactly 2x the 1440x900 resolution that the OS default scaling is suggesting I should be seeing.
I’m curious as to why this is not the screen resolution of the device 2560x1600, is MacOS behind the scenes pretending that the desktop is 2880x1800 and scaling everything down to 2560x1600 to fit to the actual display?
I haven’t looked (yet!), but are the differences between the 0.11.0 version and the nightly build significant in just this area to fix this resolution issue? I’d like to stick with the 0.11.0 distro, and do a small patch if there is one to fix this rather than switch to the nightly build and possibly inherit some other unknown changes that might effect things elsewhere…
That’s working then. Now everything will be drawn smaller, actually in the native pixel size of the retina display.
Tip: if you use ofxGui, you can call ofxGuiEnableHiResDisplay(); in the setup and it will scale the whole gui so it looks correctly…
I have no idea but it could be. Try to draw black vertical lines of 1 pixel wide separated by one pixel over a white background and see if you get a crisp pattern drawn or just a gray thing. That might give you an idea. (There might be other issues affecting this too, not sure, just guessing).
No, there are alot of other fixes as well. I often work on the github master (nightly build) as it tends to have the less amount of issues. Between 0.11.0 and the nightly build there should not be any change that will break your code, only fixes to some issues and improvements in some other areas. Yet, if you are working on some project which uses 0.11.0 and it is ok, just stick with it.