Proposal to change in FLTK 1.5 the default value of Fl::use_high_res_GL() from 0 to 1

10 views
Skip to first unread message

Manolo

unread,
Jul 24, 2026, 1:43:04 AM (10 days ago) Jul 24
to fltk.coredev
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

Albrecht Schlosser

unread,
Jul 24, 2026, 4:45:45 AM (10 days ago) Jul 24
to fltkc...@googlegroups.com
On 7/24/26 07:43 Manolo wrote:
> Proposal to change in FLTK 1.5 the default value of
> Fl::use_high_res_GL() from 0 to 1
> ...

+1 on the proposed change of the default because this feels more
"natural" than having to call this (macOS specific) function. But please
note that I'm not using OpenGL myself and this is only my formal
opinion. So, maybe I should abstain (+/- 0), but anyway.

> The proposed change would also deprecate both forms of the
> Fl::use_high_res_GL() function.

I'm against a formal deprecation, because using Fl::use_high_res_GL(0)
would be the only way to stay backwards compatible for programs that
didn't call Fl::use_high_res_GL(1) before, for whatever reason (unless I
misunderstood anything). Thus, calling Fl::use_high_res_GL(0) would be
legitimate and should not be considered deprecated (which would issue a
warning, if implemented correctly).

> Please, vote for or against this proposal to change the default value
> of Fl::use_high_res_GL() in FLTK 1.5.

See my vote and comment above.

Manolo

unread,
Jul 28, 2026, 3:06:35 AM (6 days ago) Jul 28
to fltk.coredev
The proposed change has been committed at f0c8f5a without deprecating the Fl::use_high_res_GL() functions
because, as Albrecht reported, there remains a possible use case even if highly unlikely.
Reply all
Reply to author
Forward
0 new messages