SDL_GetDisplayBounds(3)
β¨ SDL_GetDisplayBounds(3) β¨
okay bestie, so this is a page from the SDL3 FUNCTIONS manual β the whole Simple Directmedia Layer situation β and today we're talking about SDL_GetDisplayBounds. it's giving "where even IS my monitor, actually". π
π NAME π
SDL_GetDisplayBounds β get the desktop area represented by a display.
like, the actual rectangle of screen real estate that a display owns. no cap. π₯οΈβ¨
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_video.h>
bool SDL_GetDisplayBounds(SDL_DisplayID displayID, SDL_Rect *rect);
π¦ DESCRIPTION π¦
so the whole vibe here is: you hand it a display, it tells you the rectangle that display occupies. easy.
the thing to know β and this is the iconic detail β is that the primary display is often located at (0,0), but it may be placed at a different location depending on monitor layout. so don't just assume (0,0) is home, bestie. multi-monitor setups said "not today". π
π FUNCTION PARAMETERS π
displayIDβ the instance ID of the display you wanna query. the one you're being nosy about. πrectβ theSDL_Rectstructure filled in with the display bounds. this is the lil box that gets the answer dropped into it. π
π₯ RETURN VALUE π₯
returns true on success or false on failure β and if it fails, call SDL_GetError() for more information. so like, if you get a false, don't spiral, just go read the error. π«Ά
π THREAD SAFETY π
this function should only be called on the main thread.
periodt. don't be cute and try it from a worker thread, it's not that girl. π«π§΅
β AVAILABILITY β
this function is available since SDL 3.2.0. so if you're on anything older, sorry babe, no bounds for you. π
π SEE ALSO π
iykyk β go read those next, they're the rest of the display lore. π
and that's the whole page, bestie!! π this came to you straight from the Simple Directmedia Layer manual, version SDL 3.4.18 β go forth and query your displays responsibly. mwah. πβ¨π¦ππ§
π¦ 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