]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commit
vid: implement monitor selection with instant cvar changes
authorbones_was_here <bones_was_here@xonotic.au>
Wed, 4 Oct 2023 16:43:12 +0000 (02:43 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Wed, 8 Nov 2023 17:26:03 +0000 (03:26 +1000)
commit9412d05dbf840a07e21a3cb6058eb07e54d0fd10
tree376fe79863ded6ab98d6ea2f57e00f34c75fb395
parent0b02091d9a19d2a37744309eea401cf7663742a2
vid: implement monitor selection with instant cvar changes

Adds cvars: vid_display, vid_info_displaycount

Prints the monitors detected at startup and on hotplug.

Requires SDL headers >= 2.0.18 at build time.
At runtime older versions should still work but may lack some functionality.

May not work properly or at all if vid_desktopfullscreen is 0.

May require vid_restart after hotplug events.

---

Changes existing cvars vid_fullscreen, vid_desktopfullscreen, vid_resizable,
vid_borderless to apply instantly.

Also (for windowed mode) works around window managers that move the
window after SDL creates and centres it (typically when adding a
titlebar), so the crosshair is always at the centre of the monitor.

Adds some missing SDL_WINDOWEVENT enumerations.

Changes the GL viewport size retrieval from screen coordinates to
pixels, which is a prerequisite for "HIGHDPI" aka "Apple Retina"
support.

Fixes https://gitlab.com/xonotic/darkplaces/-/issues/385

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
cvar.c
vid.h
vid_sdl.c
vid_shared.c