> On 6 Nov 2020, at 12:47, anmol.mishra wrote:
>
> Looking at Fl::cairo_cc(cairo_t *), can I draw into a cairo context with 2D vector primitives, and then pass it to fltk ? Will the drawn cairo operations be recognized by fltk ?
The easiest thing might be to create a Fl_Cairo_Window as shown in cairo_test.cxx and then render the scene just using Cairo primitives.
That said, although Cairo does a nice job, I found it to be quite slow, so I ended up rendering the window content in GL instead - that was a lot more work to write the code (though modern GL might be easier... YMMV...) but the result was properly accelerated by the GPU and so was *much* faster.
And with appropriate fiddling with my GL textures and so forth I got some very nice anti-aliasing in the end, just as nice as Cairo. But that may not be any use for your application of course.