SDL_HINT_VID...PLAY_PRIORITY(3)
π SDL_HINT_VIDEO_DISPLAY_PRIORITY π
okay bestie, welcome to the SDL3 FUNCTIONS manual, and today's main character is SDL_HINT_VIDEO_DISPLAY_PRIORITY β no cap, this one is lowkey iconic if you've ever been mad about which monitor SDL thinks is "the" monitor. πΈ
β¨ NAME β¨
SDL_HINT_VIDEO_DISPLAY_PRIORITY β a comma separated list containing the names of the displays that SDL should sort to the front of the display list. fr fr, that's it, that's the whole vibe. π
π SYNOPSIS π
#include <SDL3/SDL_hints.h>
#define SDL_HINT_VIDEO_DISPLAY_PRIORITY "SDL_VIDEO_DISPLAY_PRIORITY"
π¦ DESCRIPTION π¦
so here's the tea π β when you set this hint, displays whose name strings match will get prioritized in the list of displays, the one that SDL_GetDisplays() hands you. and the first one you list becomes the primary display. periodt. π
the naming convention can vary depending on your environment, but it's usually a connector name β think 'DP-1', 'DP-2', 'HDMI-A-1', etc... iykyk.
wondering where to even find these connector names? don't stress, bestie, we got you:
- on Wayland desktops, the connector names associated with displays live in the
nameproperty of the info output fromwayland-info -i wl_output. - on X11 desktops, the
xrandrutility can be used to retrieve the connector names associated with displays.
this hint is currently supported on the following drivers:
- KMSDRM (
kmsdrm) - Wayland (
wayland) - X11 (
x11)
β οΈ okay important one, bestie: this hint should be set before SDL is initialized. set it late and it's giving nothing. π
π AVAILABILITY π
this hint has been available since SDL 3.2.0. so if you're on something older, no vibes for you, sorry. π
and that's the whole page, bestie!! π«Ά this lil slice of the manual lives under Simple Directmedia Layer, running SDL 3.4.18 β so go forth, sort your displays, and make that primary monitor the main character it was always meant to be. β¨π§π
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms