SDL_GetDisplayForRect(3)
π SDL_GetDisplayForRect(3) π
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where we find out which screen a lil rectangle is living on π₯οΈβ¨
πΈ NAME πΈ
SDL_GetDisplayForRect β get the display primarily containing a rect. that's the whole vibe, no cap π
π¦ SYNOPSIS π¦
#include <SDL3/SDL_video.h>
SDL_DisplayID SDL_GetDisplayForRect(const SDL_Rect *rect);
π FUNCTION PARAMETERS π
rectβ the rect you're querying, girl. hand it over and let's see where it belongs π«Ά
β¨ RETURN VALUE β¨
On success you get back the instance ID of the display that entirely contains the rect β or, if nobody fully claims it, the display closest to the center of the rect π If it fails? You get 0, and bestie you're gonna wanna call SDL_GetError() for more information because that's where the tea is π
π THREAD SAFETY π
This function should only be called on the main thread. periodt. don't be out here on a side thread thinking you're the main character, because in this case the main thread literally is π§
π AVAILABILITY π
This function is available since SDL 3.2.0 β so if you're on anything older, no it isn't, sorry bestie π
β SEE ALSO β
iykyk, go read those next π
mwah π this page came to you from Simple Directmedia Layer, rockin' SDL 3.4.18 β now go find your display and 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