SDL_HINT_VID...ODE_EMULATION(3)

πŸ’– SDL_HINT_VIDEO_WAYLAND_MODE_EMULATION πŸ’–

okay so bestie, this one's straight out of the SDL3 FUNCTIONS manual and it's lowkey one of those little hints that changes so much about how your Wayland app sees the world. sit down, grab a πŸ“, we're doing video modes.


✨ NAME ✨

SDL_HINT_VIDEO_WAYLAND_MODE_EMULATION β€” a variable that controls whether video mode emulation is enabled under Wayland. that's it, that's the whole job, and she does it flawlessly πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_hints.h>

#define SDL_HINT_VIDEO_WAYLAND_MODE_EMULATION "SDL_VIDEO_WAYLAND_MODE_EMULATION"

like, yes, the macro name and the string are the exact same thing, we love consistency, we stan 🫢


🌸 DESCRIPTION 🌸

so here's the tea β˜• β€” when this hint is set, a standard set of emulated CVT video modes gets exposed for your application to use. like, the whole menu. the full buffet. ✨

but if it's disabled, the only modes you get exposed are:

  • the logical desktop size, and
  • in the case of a scaled desktop, the native display resolution.

that's it. two things. bare minimum. not me getting emotional about it 😭


The variable can be set to the following values:

  • "0" β€” Video mode emulation is disabled. 🚫
  • "1" β€” Video mode emulation is enabled. βœ… (this is the default, bestie, so if you say nothing she's already on)
⚠️ real talk: this hint should be set before SDL is initialized. like, before. if you roll up late with your SDL_SetHint call after init, that's giving "showed up to the party after the cake was cut" and it won't do what you want. set it early, set it proud. πŸ’€

🌈 AVAILABILITY 🌈

this hint is available since SDL 3.2.0. so if you're on anything older... bestie, upgrade, it's giving ancient πŸ‘‘


that's the page!! go forth and emulate those modes, you absolute icon πŸ‘‘βœ¨

signing off with all the love from the Simple Directmedia Layer crew, running SDL 3.4.18, dated with this lovely SDL_HINT_VID...ODE_EMULATION(3) energy β€” mwah πŸ’‹

πŸ“¦ where this page comes from