dhewm3/neo
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
..
cm Disable Assertions in Release builds 2018-11-11 23:21:23 +01:00
d3xp Use idStr::Copynz() instead of strncpy() 2022-01-08 16:58:48 +01:00
framework Make sure MAX_OSPATH has sane size; fix some typos 2022-01-16 06:02:40 +01:00
game Use idStr::Copynz() instead of strncpy() 2022-01-08 16:58:48 +01:00
idlib Add D3_(v)snprintfC99() for C99-compatible implementations 2022-01-10 04:06:54 +01:00
MayaImport s/LittleLong/LittleInt/ to match the return type 2012-06-28 13:02:47 +02:00
renderer Make window alpha chan opaque on Wayland, fix #426 2022-02-05 16:34:34 +01:00
sound Update stb_vorbis to v1.22 and stb_image to v2.27 2021-10-31 06:14:59 +01:00
sys Make window alpha chan opaque on Wayland, fix #426 2022-02-05 16:34:34 +01:00
tools Add absolute mouse mode and refactor mouse grabbing code 2022-01-10 00:46:32 +01:00
TypeInfo Get rid of Sys_FPU_StackIsEmpty() 2012-07-06 01:06:53 +02:00
ui Add absolute mouse mode and refactor mouse grabbing code 2022-01-10 00:46:32 +01:00
CMakeLists.txt CMake: (Theoretically) support Windows on ARM, try to unify ARM CPU names 2022-01-16 18:17:39 +01:00
config.h.in Introduce CMAKE_INSTALL_PREFIX relative paths 2012-07-04 02:18:42 +02:00
mmakefile.src # move the AROS specific folder icon and default.cfg mmakefile.src under neo/sys/aros/setup 2017-04-22 16:21:14 +02:00