![]() |
|
Transparent back buffer. |
Gnamra
Member #12,503
January 2011
![]() |
I'd like to make the display / back buffer transparent, all of the solutions I found on this were for Allegro 4 except for one: SetWindowLong(al_get_win_window_handle(display), GWL_EXSTYLE, GetWindowLong(al_get_win_window_handle(display), GWL_EXSTYLE) | WS_EX_LAYERED); SetLayeredWindowAttributes(al_get_win_window_handle(display), 0, 0, LWA_ALPHA); Problem with this one is that it makes the entire window transparent, so anything I draw is also transparent. And it will only run on Windows, which isn't the worst thing even though I'm planning on having my program be cross platform compatible. It just means I'll have to spend some more time looking at X11 and whatever mac uses. To sum it up: al_clear_to_color(al_map_rgba(0,0,0,0)); //draw stuff al_flip_display();
|
Edgar Reynaldo
Major Reynaldo
May 2007
![]() |
I think what you want is UpdateLayeredWindow, but I don't think you can vary the alpha over different parts of the window, just set a transparency level for the whole window. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Gnamra
Member #12,503
January 2011
![]() |
I was able to solve my problem but I had to give up on Allegro. I used the glLayeredWindows demo to handle all of the drawing for me and modified it so I could put it in a class and use it in my project. I also used lodepng to load the png files I'm using in my project. I hope this will make it easier for others who wish to do the same.
|
beoran
Member #12,636
March 2011
|
This is indeed a missing Allegro feature. Transparent windows are possible on Linux and Windows, (and likely OSX) so we should probably implement this... one day. |
|