SDL_HINT_EMS...NVAS_SELECTOR(3)

✨ NAME ✨

SDL_HINT_EMSCRIPTEN_CANVAS_SELECTOR β€” bestie, this is the hint that lets you pick which CSS selector gets used for the "default" window/canvas πŸ’…

okay so quick vibe check first: we're deep in the SDL3 FUNCTIONS manual, and this page is gonna be short but iconic, i promise 🫢


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_hints.h>

#define SDL_HINT_EMSCRIPTEN_CANVAS_SELECTOR "SDL_EMSCRIPTEN_CANVAS_SELECTOR"

look at that #define, no cap. the hint's actual string value is literally SDL_EMSCRIPTEN_CANVAS_SELECTOR β€” copy it exactly or it will NOT hit 😭


πŸ¦‹ DESCRIPTION πŸ¦‹

so the whole tea is: this hint only applies to the emscripten platform. if you're not on emscripten, this is giving... nothing. it's not for you, babe πŸ™ˆ

and listen β€” you gotta set this hint before creating a window. like, before. it's not a "oh i'll set it later" situation. the window needs to know what it is first, so set it up front, periodt πŸ‘‘

it's the thing that tells SDL which CSS selector matches the canvas it should treat as the default window/canvas ✨


πŸ’œ AVAILABILITY πŸ’œ

this hint has been around since SDL 3.2.0. so if you're on something older, sorry bestie, it's not gonna show up to the party πŸ’€


that's the whole page, she's tiny but she's main character energy fr fr πŸŽ€

sign-off time: this lil masterpiece comes to you from Simple Directmedia Layer, living at version SDL 3.4.18, and it's filed under SDL_HINT_EMS...NVAS_SELECTOR(3) in the SDL3 FUNCTIONS section β€” slay, drink water, set your hints early πŸ’–βœ¨πŸŒˆ

πŸ“¦ where this page comes from