It's time to join the future.
Allegro needs custom OpenGL contexts and translucent windows. SDL has it, why not us?
So, I'm starting a project to get it done.
Step 1) Create a basic working example on every platform without using allegro. OpenGL and system calls only.
Step 2) Integrate custom OpenGL context creation into Allegro.
1a) Win32 and WGL
1b) X11, XLib, and XGL
1c) OSX, OpenGL
I'll start working on 1a. A Win32 example with WGL.
If anyone can tackle 1b or 1c, we'll get this done in no time.
This is something I have wanted to do for a long time, and I'm going to get it done if it kills me.
Edgar
Good idea. I'm not fluent enough in OpenGL to help you, but I can make some tests if needed (Windows/Linux/Android)
Well, I've got a win32 OpenGL solution 'mostly' working.
It's translucent, but for some reason, it's like it's over gray at 1/2 alpha and I can't explain why.
https://github.com/EdgarReynaldo/TransAllegro
{"name":"Trans3.png","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/3\/6\/36fa9553a11faa418c6300affd33af6b.png","w":1920,"h":1080,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/3\/6\/36fa9553a11faa418c6300affd33af6b"}
This is definitely way over my skill level and a good addition to Allegro.
Though, I am not sure even what could be suggested to help understand why it would be like that.
In all actuality, once you get past all the misinformation and crap on the internet, it's actually quite easy.
Working win32 demo. Try it!
Sorry to report... I get a blank black rectangle in top-left corner of the screen.
EDIT: not sure if this helps:
What version of Windows are you using?
Is your desktop 32 bit color depth?
I'm on IRC on #allegro right now. Meet me there. Allegro.cc is being sketchy.
Windows 10, 32 bit.
I'll try the IRC though have never used it before so might be a minute or two...
Is translucency enabled in your desktop?
log
Since the first demo doesn't work for you, try this one :
https://www.allegro.cc/files/attachment/612221
The first one uses a hacked Allegro.
This one is straight win32 and OpenGL, with a little help from datenwolf.
Both work - I just needed a little patience for the bitmaps to load.
All source code for the stand alone win32 opengl demo can be found here :
https://github.com/EdgarReynaldo/TransAllegro/tree/master/src/win
Note it borrows some helper functions from datenwolf and his wglarb demo, which can be found here :
https://github.com/datenwolf/wglarb
The gist of it is really simple.
1) Register a window class. The class style can be 0 or CS_OWNDC or perhaps others (not tested).
2) Create a window with CreateWindowEx, specifying WS_EX_APPWINDOW for the extended style and WS_POPUP for the style.
3) Create an OpenGL context that has 32 bit color, 8 bit alpha, and the WGL_TRANSPARENT_ARB extension enabled.
4) Use DWM to blur the window. DwmEnableBlurBehindWindow and DwmExtendFrameIntoClientArea are necessary to set up the window correctly so that the client area is NOT blurred (only non-blurred regions are drawn using alpha values [ yes this is as backwards as your reflection in the mirror ]).
DWM_BLURBEHIND bb = {0,0,0,0}; bb.dwFlags = DWM_BB_ENABLE; bb.fEnable = TRUE; bb.hRgnBlur = NULL; HRESULT hr = DwmEnableBlurBehindWindow(hwnd, &bb); if (FAILED(hr)) { printf("Could not enable blur behind."); } MARGINS margins = {-1}; DwmExtendFrameIntoClientArea(hwnd, &margins);
5) Draw with OpenGL and enjoy.
UPDATE :
I found working source code on the internet from datenwolf for an XGLX translucency example. I haven't figured out exactly what does what yet, but I'm working on that.
Can people with some flavor of *NIX compile this and try it?
Compilation should be as easy as :
g++ -Wall -g -I/usr/include -c xglx_trans.cpp -o xglx_trans.o g++ -L/usr/X11/lib -L/usr/lib/x86_64-linux-gnu -o XTranslucency xglx_trans.o -lX11 -lGLX -lGLU -lGL -lXrender
UPDATE
I know y'all are a bunch of nerds with computers. Help me test this and I'll give you a free lollipop. 
Windows :
https://www.allegro.cc/files/attachment/612221 Spinny triangle
https://www.allegro.cc/files/attachment/612219 This one's fun
Linux
https://www.allegro.cc/files/attachment/612224 Spinny cube
I tried the Windows example. The translucency on the triangle was working fine but there was none on the running man.
{"name":"lollipop1.jpg","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/4\/8\/48d0423c04adcaa027b88d78ae5a5195.jpg","w":390,"h":600,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/4\/8\/48d0423c04adcaa027b88d78ae5a5195"}
Interesting, LennyLen. I'll look into it. What version of Windows are you running?
The running man example was with a quickly hacked allegro.
The triangle was clean win32 and opengl with help from wglarb by datenwolf.
Interesting, LennyLen. I'll look into it. What version of Windows are you running?
Windows 10, version 1903, OS build 18362.476
I'm running the same version, and it works for me.... ?
And I can't tell the difference between what I did with datenwolf's wglarb and my hacked allegro.
So I don't know why it's not working. Can you post your allegro.log file for me?
You can also run it from the command line and see if there are any errors.
I'm running the same version, and it works for me.... ?
Is the running man himself supposed to be translucent or is the background just supposed to be transparent? Because if it's the latter, then it is working.
There were no errors while running from the command line, and the log file is attached.
Ah, good. So it is working. There was no aliasing on the running man, just wanted to see him run around my desktop. So no square window right?
EDIT
I should note, WGL_TRANSPARENT_ARB is not required at all. It's a total duck. The only thing necessary for a translucent win32 window is WS_POPUP style and enabling blur behind with DWM (note the invalid margins are important!).
*EDIT*
Here's the same running man demo, but he's on top, and up and down keys control alpha value, so you can see he's really translucent.
So no square window right?
Correct.
Here's the same running man demo, but he's on top, and up and down keys control alpha value, so you can see he's really translucent.
I think you attached the wrong project.
Derp. Sorry.
Seems to be working fine.
When you turned the alpha down, was it still pretty red on his shoes when he was supposed to be all translucent?
So because you only need DWM, this also works for DX, so it's now a win32 translucency function that I'm adding to allegro.
Thanks to Elias, we can do it on X11 with GLX now too.
Any OSX users out there? We need your help!
EDIT
Can anyone on OSX test this code?
Peter Hull? Mark Oates? SiegeLord? Anybuddy?
EDIT2
Derp. doesn't anyone use OSX?
I'll give it a try. Please keep ping me until I do, as I'm liable to forget
.
SiegeLord - two week bump
i download the source code from https://github.com/EdgarReynaldo/TransAllegro
i guess that have all...
No, that doesn't have the code. I haven't submitted it yet.
All you need is step 4 and 32 bit color backbuffer.
https://www.allegro.cc/forums/thread/617989/1044177#target
EDIT
Just to re-iterate :
Thread bump anyone?
Downloaded and tried your demo on Windows 10, works well. Made me chuckle, nicely done.
In all actuality, once you get past all the misinformation and crap on the internet, it's actually quite easy.
Boy, you got that right! There's a lot of legacy, deprecated code examples out there.
Can't wait until it's mainlined. I hope it'll !