SDL_GetCurrentDisplayMode(3)
π SDL_GetCurrentDisplayMode π
okay bestie, welcome to the SDL3 FUNCTIONS manual, page SDL_GetCurrentDisplayMode(3) π β yes it's a whole vibe, yes it's in <SDL3/SDL_video.h>, and yes we're gonna get you fluent in it. no cap.
β¨ NAME β¨
SDL_GetCurrentDisplayMode β get information about the current display mode. that's it, that's the whole job. iconic. π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_video.h>
const SDL_DisplayMode * SDL_GetCurrentDisplayMode(SDL_DisplayID displayID);
look at her. returns a const SDL_DisplayMode *, takes one SDL_DisplayID. clean, simple, slay. π
π¦ DESCRIPTION π¦
okay so here's the tea β β there's a difference between this function and SDL_GetDesktopDisplayMode() when SDL runs fullscreen and has changed the resolution. and that difference is the entire point of this function, so pay attention bestie π
in that case, this function will return the current display mode, and not the previous native display mode. so like, if SDL went fullscreen and swapped the resolution on you, SDL_GetCurrentDisplayMode is the one telling you what's happening right now, while the desktop one is still out here living in the past. main character vs. nostalgia. β¨
π FUNCTION PARAMETERS π
displayIDβ the instance ID of the display to query. just hand her the display you're curious about, she'll do the rest. π«Ά
π RETURN VALUE π
*)Returns a pointer to the desktop display mode, orNULLon failure. π
if you getNULL, do not panic β callSDL_GetError()for more information. she'll tell you what went wrong, fr fr.
π₯ THREAD SAFETY π₯
This function should only be called on the main thread. that's it. no side quests, no background threads, no sneaking it into a worker. main thread only, periodt. π
π AVAILABILITY π
This function is available since SDL 3.2.0. so if your SDL is older than that, sorry babe, she's not home. π§
β SEE ALSO β
go read those too, they're literally her sisters. iykyk. π
and that's the whole page, bestie!! πβ¨ this came to you from the Simple Directmedia Layer girlies, SDL 3.4.18, and yeah β SDL_GetCurrentDisplayMode(3). go query your displays, you absolute icon. π¦π
πΈ
π¦ 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