Hi,
I'm aware this question has been asked before but it has not been solved. I looked into this quite a bit and it turns out that this is a complex problem after all. I "only" want to have a fully transparent window with per-pixel alpha SFML drawings on top. I also aware that this is a non-trivial task. I settled on using Qt and SFML in combination to get the best odds in solving this.
Basically, I figured I'll want two codepaths for my window-less application:
Path 1 is without a compositing window manager (No Kwin, Aero or Compiz active). It will just take a screenshot at the beginning using Qt since SFML can't do that for me yet, sadly (hint, hint), and put it as the window background with the correct subrect. This works and obviously is sub-optimal.
Path 2 is the part I'm struggling with. I'd like to make use of an available desktop compositor as many modern desktops are running one. This will save me from the screenshotting but presents me with other problems. SFML can't make a transparent window and thus I used Qt with the window attributes Qt::WA_NoSystemBackground and Qt::WA_TranslucentBackground. This works (the window is transparent when a compositor is active) but this is also the place where I'm struggling.
I now need to get my SFML data into Qt somehow draw it on top. Or can I directly use the SFML canvas trick from the tutorials and somehow make it transparent? Clear() can't clear to alpha.
Help