FL_MULTISAMPLE seems to be ignored on Windows

已查看 36 次
跳至第一个未读帖子

Mo_Al_

未读,
2022年9月28日 08:25:002022/9/28
收件人 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

未读,
2022年9月28日 11:20:562022/9/28
收件人 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_

未读,
2022年9月28日 12:30:382022/9/28
收件人 fltk.general

Sure, will do and report back.

Mo_Al_

未读,
2022年10月18日 05:46:522022/10/18
收件人 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

未读,
2022年10月19日 12:11:582022/10/19
收件人 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_

未读,
2022年10月20日 05:51:232022/10/20
收件人 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

回复全部
回复作者
转发
0 个新帖子