This reverts commit 1707ee1986.
Under X11, grabbing the keyboard has negative side effect of
rendering Alt-Tab useless in windowed mode. Multimedia volume keys
are rendered useless in windowed or fullscreen mode. When execution
of descent3 is suspended (e.g. when running under a debugger), it
would be impossible to get out of it even in fullscreen mode, since
the SDL handler does not run.
Looking at other games, I find that many other engines
(chocolate-doom, gzdoom, yquake2, sauerbraten, but also gl-117) do
not exercise keyboard grabbing either and only use relative mouse
mode (mouse grab).
Gamma Correction function hhas been removed in SDL3, so do it in shader code instead. This is a better solution because it allows to perform this correction only on the game window, which was not the case for the SDL function.
Using high-DPI support with a scale factor would not scale the game window. We now take the scaling factor into account, so that the Descent3 game window is bigger if the user chooses a bigger scale factor. Also use the SDL_WINDOWPOS_UNDEFINED_DISPAY with display id, fixing the '-display' argument.
Read more here: https://wiki.libsdl.org/SDL3/README/highdpi
The new command line option -display lets the user select the display on
which Descent 3 should be displayed.
This is useful in multi-monitor setups where the game now can be run on any of
the given monitors.
Use orphaned "buffer update streaming" to eliminate synchronization
delays, due to CPU->GPU latency, causing framerate slowdowns. This sends
vertex data to the GPU via partial updates to a buffer and reallocates
the buffer once it fills up, ensuring that no synchronization is ever
needed. The buffer is sized to balance memory usage vs allocation rate,
and the GL driver ensures that "orphaned" buffers are only destroyed
when all GL commands using them are retired.