I tried the following:
#include <FL/Fl_Window.H>
#include <FL/Fl_Widget.H>
#include <FL/fl_draw.H>
#include <iostream>
class MyWin: public Fl_Window
{
public:
//using Fl_Window::Fl_Window;
MyWin( int x, int y, int w, int h, const char* title = 0 ):
Fl_Window(x,y,w,h,"Hallo Welt!")
{
}
void draw() override
{
Fl_Window::draw();
std::cout << "Draw!" << std::endl;
Fl::set_color(1, 0xff, 0x0, 0x0, 0x80 );
Fl::set_color(2, 0x00, 0xff, 0x0, 0x80 );
fl_line_style( FL_SOLID, 20 );
fl_color(1);
fl_line( 10,10,100,100 );
fl_color(2);
fl_line( 10,100,100,10 );
}
};
int main()
{
auto win = new MyWin(1,1,900, 600, "Test");
win->show();
Fl::run();
}
But I can't see any transparency. I expected some effects on the line crossing but the green line is simply drawn over the red one. What I did wrong?
Regards
Klaus