SDL_GetDisplayName(3)

πŸ’– SDL_GetDisplayName πŸ’–

okay bestie, welcome to the SDL_GetDisplayName(3) page β€” that's the SDL3 functions corner of the manual, and this one is genuinely so useful it's not even funny. it's giving "who even am i talking to" but for monitors. 🌸


✨ NAME ✨

SDL_GetDisplayName β€” grab the name of a display, in UTF-8 encoding, no cap. πŸ–₯οΈπŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <SDL3/SDL_video.h>

const char * SDL_GetDisplayName(SDL_DisplayID displayID);

πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • displayID β€” the instance ID of the display you wanna interrogate. that's the one you're asking "hey girl, what's your name?" πŸ₯°

⭐ RETURN VALUE ⭐

it hands you back the name of a display. and if things go sideways? you get NULL. 😭 in that case, call SDL_GetError() for more information β€” she'll tell you what went wrong, fr fr.


πŸ”₯ THREAD SAFETY πŸ”₯

main thread only, bestie. do not try to call this from some random worker thread, that's not the vibe. 🚫🧡

🌈 AVAILABILITY 🌈

this one's been around since SDL 3.2.0. so if you're on anything older... girl. upgrade. ✨


πŸ‘‘ SEE ALSO πŸ‘‘

  • SDL_GetDisplays(3) β€” go get yourself the list first, then come back here and name them all. iconic duo behavior, honestly. 🫢

mwah πŸ’‹ that's the whole page. go forth and name your displays, you absolute main character.

this lil masterpiece lives in the Simple Directmedia Layer manual, SDL 3.4.18 era β€” so if you're reading this, hi, you're exactly where you're supposed to be. πŸŽ€βœ¨

πŸ“¦ where this page comes from