FL_MULTISAMPLE seems to be ignored on Windows

36 views
Skip to first unread message

Mo_Al_

unread,
Sep 28, 2022, 8:25:00 AM9/28/22
to fltk.general
Hello

I've been playing around adding widgets to an Fl_Gl_Window, I'm aware its being work on still. I noticed that passing FL_MULTISAMPLE does provide anti-aliasing on Linux (X11) and MacOS but not on Windows.

#include <FL/Fl.H>
#include <FL/Enumerations.H>
#include <FL/Fl_Gl_Window.H>
#include <FL/Fl_Line_Dial.H>

int main() {
    auto win = new Fl_Gl_Window(400, 300);
    win->mode(FL_MULTISAMPLE);
    win->box(FL_FLAT_BOX);
    win->begin();
    auto dial = new Fl_Line_Dial(100, 50, 200, 200, "");
    dial->selection_color(FL_BLUE);
    dial->color(FL_RED);
    dial->box(FL_OFLAT_BOX);
    win->end();
    win->show();
    return Fl::run();
}

windows:
winmultisample.jpg

Linux (X11):
linmutli.jpg

Also win->mode(FL_OPENGL3 | FL_MULTISAMPLE); 
would break antialiasing on MacOS, whereas removing the FL_OPENGL3 fixes it.

imm

unread,
Sep 28, 2022, 11:20:56 AM9/28/22
to fltkg...@googlegroups.com
On Wed, 28 Sept 2022 at 13:25, Mo_Al_ wrote:
Hello

I've been playing around adding widgets to an Fl_Gl_Window, I'm aware its being work on still. I noticed that passing FL_MULTISAMPLE does provide anti-aliasing on Linux (X11) and MacOS but not on Windows.

Mo,

Might be a bit of a long-shot, but can you try it on a few different machines?
I've seen weirdness like this from Win32 GL drivers in the past, with stuff working on some machines and not others, that sort of thing. In particular I remember the Intel GPU's having some pretty feeble GL driver support... They may have improved over time though, who knows!?

 

Mo_Al_

unread,
Sep 28, 2022, 12:30:38 PM9/28/22
to fltk.general

Sure, will do and report back.

Mo_Al_

unread,
Oct 18, 2022, 5:46:52 AM10/18/22
to fltk.general
Sorry for the delayed response. I just had the chance to try it on a second Windows system, and the lack of FL_MULTISAMPLE is apparent.

Ian MacArthur

unread,
Oct 19, 2022, 12:11:58 PM10/19/22
to fltk.general
On Tuesday, 18 October 2022 at 10:46:52 UTC+1 Mo wrote:
Sorry for the delayed response. I just had the chance to try it on a second Windows system, and the lack of FL_MULTISAMPLE is apparent.

On Wednesday, September 28, 2022 at 7:30:38 PM UTC+3 Mo_Al_ wrote:

Sure, will do and report back.
On Wednesday, September 28, 2022 at 6:20:56 PM UTC+3 Ian MacArthur wrote:
On Wed, 28 Sept 2022 at 13:25, Mo_Al_ wrote:
Hello

I've been playing around adding widgets to an Fl_Gl_Window, I'm aware its being work on still. I noticed that passing FL_MULTISAMPLE does provide anti-aliasing on Linux (X11) and MacOS but not on Windows.

Huh... well, there you go. I could have sworn this worked under Windows, but I just stared at the code for a bit and it doesn't seem like it ever can have.

Under Wayland it looks like it would work if a suitably capable egl is available; under X11 if a suitably capable GLX is available.
It doesn't seem to be used under MacOS, but I suspect it looks like it Just Works because Mac rendering tends to be anti-aliased anyway   (guess)

Under Win32 it is not used, I think because the PIXELFORMATDESCRIPTOR mechanism used to request the GL surface does not have a multisample option, basically. Though I may be wrong about that, as ever!

I know I've done anti-aliased drawing in GL on Windows, but that was by dint of messing about with the texture buffer modes and such, once the basic GL Window was created, not by use of FL_MULTISAMPLE. 
Which is not really all that helpful I guess.

 

Mo_Al_

unread,
Oct 20, 2022, 5:51:23 AM10/20/22
to fltk.general
Oh I see. I noticed it works on macos when using Opengl 1, however when activating Opengl 3 or above, FL_MULTISAMPLE doesn't appear to work.
Thank you for your explanation

Reply all
Reply to author
Forward
0 new messages