This is
more a GL question than a fltk one, really, I guess. Once you have
your GL context in fltk, say in a Fl_Gl_Window, then what you draw
in there is pretty much up to you.
As Bill says, FSAA is probably the way to go; basically create
your frame buffer in some MSAA mode and then render your scene
pretty much as normal and let the buffer take care of the AA for
you...
I've found opengl features in general are very machine specific.
For instance my linux machine's OpenGL can't seem to do AA at
all, even for
simple line drawing. But on the mac it's much better.
For instance to get the cube example to render wire frames with
antialiasing,
I added these to the cube_box::draw() !valid() section:
Despite I couldn't grab the cube at the same position + size
between runs,
you can see the jaggies clearly in the left image, and less so
in the right.
Here's a blowup of the above two images at 3x scale (using no
interpolation) to see the details:
I wasn't able to get the flat polygon rendering to work, probably
because of the reasons Bill mentioned,
and I wasn't sure how to enable full screen anti-aliasing; that
seems to be a feature of the window,
and I'm not sure how to control that. I'm also not familiar with
the "new" opengl stuff yet.
Comments are owned by the poster. All other content is copyright 1998-2025 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.