SDL_HINT_VID..._MODE_SCALING(3)

πŸ’… SDL_HINT_VIDEO_WAYLAND_MODE_SCALING β€” the manual page, but make it cute

okay bestie, so this is a page from the SDL3 FUNCTIONS manual, and it's about one very specific little hint variable. buckle up, it's short but it's important πŸ¦‹


✨ NAME ✨

SDL_HINT_VIDEO_WAYLAND_MODE_SCALING β€” a variable that controls how modes with a non-native aspect ratio get displayed under Wayland. that's it, that's the whole job πŸ’–


🌸 SYNOPSIS 🌸

like, literally just include the header and there's a define, periodt:

#include <SDL3/SDL_hints.h>

#define SDL_HINT_VIDEO_WAYLAND_MODE_SCALING "SDL_VIDEO_WAYLAND_MODE_SCALING"

see how the macro name and the string are the same words? iconic behavior tbh. no cap.


πŸ‘‘ DESCRIPTION πŸ‘‘

so here's the tea πŸ“: when this hint is set, the scaling you asked for gets used whenever you're displaying fullscreen video modes that don't match the display's native aspect ratio. the way that this only works is contingent on compositor viewport support β€” so it's giving "depends on your compositor being chill about it", iykyk.

the variable can be set to these values, and you will be choosing one:

  • "aspect" β€” video modes get displayed scaled, in their proper aspect ratio, with black bars. letterboxing era πŸ’€
  • "stretch" β€” video modes get scaled to fill the entire display. this one is the default 🫢
  • "none" β€” video modes get displayed as 1:1 with no scaling at all. raw. unfiltered. main character energy.
⚠️ girly pop, listen: this hint should be set before creating a window. do not wait until after. that's the rule and I don't make them, I just relay them 😭

⭐ AVAILABILITY ⭐

this hint is available since SDL 3.2.0. so if you're on something older… yeah no, it's not there, sorry babe πŸ™ˆ


that's the whole page bestie, you ate it πŸ’…

Simple Directmedia Layer β€” SDL 3.4.18 β€” and that footer's the version + source tag for this page (no date on it, fr fr, so I'm not gonna invent one, that's a tech-claims no-no). bye pookie, go set your hint before the window πŸŒˆβœ¨πŸŽ€

πŸ“¦ where this page comes from