Proposal to change in FLTK 1.5 the default value of Fl::use_high_res_GL() from 0 to 1
Effect: under macOS, GL-using apps draw at High Resolution when they run on a retina display; it's no longer necessary to call Fl::use_high_res_GL(1) before mapping the first GL window to screen to obtain this feature; the source code of a GL-using app no longer requires this function call with effect only under macOS.
Formally possible but highly unlikely negative effect: a GL app that purposely would not call Fl::use_high_res_GL(1) and that would be expected under macOS to produce low-resolution GL graphics even when mapped to a retina display would no longer do that. It would instead draw GL graphics twice too small. It would be enough to add a call to Fl::use_high_res_GL(0) to the source code to restore the previous app's behavior. However, such an app is highly unlikely in the context of FLTK 1.4 and above which allows screen scaling with cmd/+/-/0/. That's because scaling support requires to replace calls to
glViewport(0, 0, w(), h());
by
glViewport(0, 0, pixel_w(), pixel_h());
and this also gives the app support of retina displays.
Rationale: macOS introduced retina displays (in macOS 10.7 in 2011) in such a way that apps could use the same coordinates independently of whether a window maps to a retina or non-retina screen. To obtain the same effect with GL-using apps, macOS 10.7 introduced the wantsBestResolutionOpenGLSurface property and gave it the FALSE default value. With this, an unchanged app would draw correctly sized GL graphics on retina display to the price of drawing them at low resolution. An app could draw high resolution GL graphics on retina displays setting wantsBestResolutionOpenGLSurface to TRUE but this required some change to the app source code. FLTK followed this logic introducing function Fl::use_high_res_GL() with a default value of 0 and requiring to call Fl::use_high_res_GL(1) to produce high resolution GL graphics on retina displays. In macOS 10.15 (2019), Apple changed the default value of property wantsBestResolutionOpenGLSurface to TRUE. With the appearance of app scaling in FLTK 1.4.0, GL-using apps, whatever the platform, need to modernize their calls to glViewport() replacing Fl_Window::w() and h() by Fl_Window::pixel_w() and pixel_h(). The usefulness of letting Fl::use_high_res_GL() be 0 by default therefore is much reduced. Changing this default value to 1 removes the requirement to call Fl::use_high_res_GL(1) for an FLTK app to produce high resolution GL graphics on retina displays under macOS. This makes FLTK more platform-independent because no call with effect only under macOS is necessary any longer.
The proposed change would also deprecate both forms of the Fl::use_high_res_GL() function.
Please, vote for or against this proposal to change the default value of Fl::use_high_res_GL() in FLTK 1.5.
Manolo