[Feature request] Support Wayland natively
It will be good to support Wayland. I still can run OpenSpades on Wayland via XWayland, but it works bad with some features such as scaling (personally I use 1.25 scaling on my 14" laptop). If you use scaliing on Wayland, all XWayland clients become blurry, OpenSpades becomes unplayable.
This should just require an upgrade of the windowing library?
This should just require an upgrade of the windowing library?
OpenSpades uses OpenGL, it's not as trivial as it would be with GTK or Qt. Wayland uses EGL, X uses GLX
SDL2 does have a Wayland support (https://github.com/libsdl-org/SDL/issues/2710), which can be enabled by specifying env SDL_VIDEODRIVER=wayland. GLEW needs to be configured for EGL at build time (glew vs glew-egl on NixOS); otherwise it'll fail to initialize with "Unknown error".
I tried this just now (coincidentally I use a Wayland-based desktop and 1.25 scaling, too). Unfortunately, it seems more broken than running on XWayland in the following ways:
- The pixel format is locked to RGB565, which causes severe banding.
- In the full screen mode, the specified screen resolution is ignored.
- Also in the full screen mode, the window size is larger than the screen. (Similar to #927; I think the final window size is incorrectly calculated as
final_size_in_logical_pixels = monitor_size_in_physical_pixels.) - In the window mode, the window is not centered on the screen.
- The startup window lacks a window decoration. (https://github.com/libsdl-org/SDL/issues/3739)
OpenSpades uses OpenGL, it's not as trivial as it would be with GTK or Qt. Wayland uses EGL, X uses GLX
That has nothing to do with each other. You can request a variety of contexts (including OpenGL) via EGL and other APIs both under Wayland and X. Wayland just gives you a buffer, it doesn't care much how you render into it.
considering i don't see it mentioned, thought i would let you know that on manjaro sway (version 1.8.1) the mouse is invisible when SDL_VIDEODRIVER is set to wayland