> Thank you, I will consider using it. I think the result would look nice.
Your most welcome; the code is probably not optimal - as I was writing it I was bugged by a sense that I was missing some sensible optimization, just couldn't see what.
That said, in testing, the code ran with very little CPU load, so I think it may be "Good Enough" as it stands.
Needs a bit of a tidy up, of course, and the means to draw arbitrary poly's rather than just rectangles, and to set the colour and alpha of the poly. I might even add those; though maybe not...
Still, if this approach *does not* work for you, doing it via GL is probably the better bet, since it is probable that will better leverage the abilities of the GPU to do the heavy lifting.
But don't assume any given solution will be slow; always test it!
Modern GPU's are very good at 2D rendering, so often things that look like they would be slow or expensive to do turn out to be much better than expected.
> I guess it is out of the scope to look for a function :
> void fl_color (uchar r, uchar g, uchar b, uchar a);
> so than you could spesify transparency along with the color.
> To be available for all drawing functions...
> would be a nice feature tough.. I do not know the internal code
> of fltk, but that may be a big job ??
The core 2D rendering API's in fltk are intended to provide the basic functionalities for the GUI controls and such, and largely mirror the underlying API's of the underlying systems that we wrap.
Things like transparency and so forth aren't really part of that API - they are more part of the compositing of the window and such.
Now, toolkits like Cairo or AGG can do this for you, and you can use them from fltk. I don't have much experience with AGG, but I do use Cairo on occasion - it works very well, but I find it to be slow at times.
For fltk, we never felt this was the right way to go though; instead, we try to make it trivial to use GL instead, and that is worth looking at. As others have said, it would be fairly straightforward to load your map into a GL surface and draw blended polys on to it. So if my code isn't going to work for you, that would be a thing to try next, I suggest.