dhewm3/neo/sys
Daniel Gibson 699779e9ca Make window alpha chan opaque on Wayland, fix #426
For some reason Wayland thought it would be clever to be the only
windowing system that (non-optionally) uses the alpha chan of the
window's default OpenGL framebuffer for window transparency.
This always caused glitches with dhewm3, as Doom3 uses that alpha-chan
for blending tricks (with GL_DST_ALPHA) - especially visible in the main
menu or when the flashlight is on.
So far the workaround has been r_waylandcompat which requests an OpenGL
context/visual without alpha chan (0 alpha bits), but that also causes
glitches.
There's an EGL extension that's supposed to fix this issue
(EGL_EXT_present_opaque), and newer SDL2 versions use it (when using
the wayland backend) - but unfortunately the Mesa implementation is
broken (seems to provide a visual without alpha channel even if one was
requested), see https://gitlab.freedesktop.org/mesa/mesa/-/issues/5886
and https://github.com/libsdl-org/SDL/pull/4306#issuecomment-1014770600
for the corresponding SDL2 discussion

To work around this issue, dhewm3 now disables the use of that EGL
extension and (optionally) makes sure the alpha channel is opaque at
the end of the frame.
This behavior is controlled with the r_fillWindowAlphaChan CVar:
If it's 1, this always is done (regardless if wayland is used or not),
if it's 0 it's not done (even on wayland),
if it's -1 (the default) it's only done if the SDL "video driver" is
  wayland (this could be easily enhanced later in case other windowing
  systems have the same issue)

r_waylandcompat has been removed (it never worked properly anyway),
so now the window always has an alpha chan
2022-02-05 16:34:34 +01:00
..
aros dhewm3log.txt for AROS 2022-01-16 06:12:51 +01:00
cmake Use stb_vorbis instead of libogg and libvorbis(file) 2021-04-27 20:08:59 +02:00
linux POSIX: log output to save_path/dhewm3log.txt 2022-01-16 06:11:20 +01:00
osx Fix Mac build 2022-01-17 15:31:10 +01:00
posix POSIX: log output to save_path/dhewm3log.txt 2022-01-16 06:11:20 +01:00
stub Make window alpha chan opaque on Wayland, fix #426 2022-02-05 16:34:34 +01:00
win32 dhewm3log.txt for Windows, update changelog 2022-01-16 18:17:39 +01:00
cpu.cpp Fix sys/cpu.cpp for msvc 64bit 2012-07-06 01:06:59 +02:00
doom_icon.h Window Icon, make in_nograb work with SDL2 2015-03-02 00:03:30 +01:00
events.cpp Add absolute mouse mode and refactor mouse grabbing code 2022-01-10 00:46:32 +01:00
glimp.cpp Make window alpha chan opaque on Wayland, fix #426 2022-02-05 16:34:34 +01:00
platform.h Make sure MAX_OSPATH has sane size; fix some typos 2022-01-16 06:02:40 +01:00
sys_local.cpp Get rid of Sys_FPU_StackIsEmpty() 2012-07-06 01:06:53 +02:00
sys_local.h Get rid of Sys_FPU_StackIsEmpty() 2012-07-06 01:06:53 +02:00
sys_public.h Add absolute mouse mode and refactor mouse grabbing code 2022-01-10 00:46:32 +01:00
threads.cpp Add SysIsMainThread() function 2021-06-20 03:36:39 +02:00