SDL_GETFULLSCREENDISPLAYMODES(3)
π SDL_GetFullscreenDisplayModes(3) π
okay bestie, so this is a page from the SDL3 FUNCTIONS manual, and today we're talking about SDL_GetFullscreenDisplayModes β literally the girl who tells you every single fullscreen glow-up your display can serve. no cap. π¦
β¨ NAME β¨
SDL_GetFullscreenDisplayModes β get a list of fullscreen display modes available on a display. that's it, that's the whole job, and she does it flawlessly. π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_video.h>
SDL_DisplayMode ** SDL_GetFullscreenDisplayModes(SDL_DisplayID displayID, int *count);
likeβ¦ look at her signature. iconic. π
π DESCRIPTION π
so you hand her a display, she hands you back every fullscreen mode that display can do. and not in some chaotic random order β she sorts them with actual main character energy, this exact priority:
w-> largest to smallesth-> largest to smallest- bits per pixel -> more colors to fewer colors
- packed pixel layout -> largest to smallest
- refresh rate -> highest to lowest
- pixel density -> lowest to highest
so yeah, the big juicy resolutions come first, and it trickles down from there. she's organized, she's picky, she's right. periodt. π
π FUNCTION PARAMETERS π
displayIDβ the instance ID of the display to query. like, which screen are we talking about, bestie? πcountβ a pointer filled in with the number of display modes returned, and it may beNULL. no pressure, she handles it either way.
β RETURN VALUE β
she returns a NULL terminated array of display mode pointersβ¦ or NULL on failure π (in which case pls call SDL_GetError() for more info, she'll tell you what went wrong, she's not mysterious about it).
and listen β it's a single allocation, so when you're done with it you HAVE to free it with SDL_free(). do not ghost that array, that's rude and also a leak. π«Ά
no like fr, SDL_free() it. one allocation, one free. we love a clean exit. β¨
π₯ THREAD SAFETY π₯
this function should only be called on the main thread. do not be out here trying to run her from a side thread, she will not answer, that's not her vibe. π
π AVAILABILITY π
this function is available since SDL 3.2.0. so if you're on something olderβ¦ bestie, upgrade. π
π¦ SEE ALSO π¦
like yeah, go meet her friends, they're all lovely.
Simple Directmedia Layer β SDL 3.4.18 π
and that's the whole page, mwah. go get those display modes, you're gonna slay. πβ¨π
π¦ 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