Fixes for GLFW on Wayland
Corresponding re3 PR: https://github.com/GTAmodding/re3/pull/723
Hm....appveyor doesn't seem to like it?
hm, GLFW_TRANSPARENT_FRAMEBUFFER is not defined in the glfw version used on CI. Well, it seems to default to false anyway, left it out now.
Hm....I'm not happy about 0 alpha bits. FB alpha may not be used in gta 3 but it is used in PS2 VC (for water) and SA (for moon phases) so I think we need some other solution here. is there a way to figure out if you're running on wayland at runtime perhaps?
Hmm, how would FB alpha be used for that? Surely no game ever wants to have other desktop windows visible through game objects..
Blending alpha directly to the FB works fine, GTA3 uses this even for the menu — which is why I can see my terminal through this selected menu item without the patch:

I'm pretty sure other platforms are already using 0 alpha bits because no preference was provided. Actually, please do check glfwWindowHint(GLFW_ALPHA_BITS, 8) on your platform, possibly with glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_TRUE) as well. I would expect the same effect..
FB alpha isn't used to make the window transparent, it's used for certain kinds of blending. As i said it's not even used in the PC gta games, but on the PS2 it is used so I would like to have it available if possible. I realize that my handling of it isn't great yet, but i certainly don't want to force it to 0.
Interesting, how does that even work? I guess there's nothing behind the "window" on the PS2 so having alpha there is fine, but then how is it used for blending.. is it blending the current FB contents onto something?
I think if you try to run these effects on PC (GLFW), you're likely to get that window transparency..
And setting this in GLFW doesn't impact the PS2 backend.
it's called destination alpha. it's just some value in the framebuffer that you can use in the blending equation. The reason i want it is because these things aren't really PS2 specific. d3d and opengl support it. We should find another way to decide if we have to set it to 0.
This is a GLFW bug that should be fixed there, imo.
There are also other bugs with GLFW on wayland like this: https://github.com/glfw/glfw/issues/1710