SDL_GetDisplayForPoint(3)
β¨ SDL_GetDisplayForPoint β¨
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual π this one's called SDL_GetDisplayForPoint, and it does exactly one (1) thing and does it gorgeously.
π NAME π
SDL_GetDisplayForPoint β get the display containing a point.
like. you hand it a point. it tells you which display that point lives on. that's the whole vibe. no cap. π¦
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_video.h>
SDL_DisplayID SDL_GetDisplayForPoint(const SDL_Point *point);
yep, that's the whole signature, isn't it precious π«Ά it hands you back an SDL_DisplayID and it wants a pointer to an SDL_Point.
π§ FUNCTION PARAMETERS π§
pointβ the point to query. that's it, that's the girl. you give her a point, she snitches on which display is holding it π
β RETURN VALUE β
Returns the instance ID of the display containing the point β or 0 on failure π and if it does fail, you go call SDL_GetError() for more information, because she's not gonna explain herself unprompted, you have to ask.
fr fr: 0 means something went wrong, not "display number zero". go read the error, bestie.
π THREAD SAFETY π
This function should only be called on the main thread. periodt. don't try to be cute from a worker thread, it's giving chaos and not the fun kind π
π AVAILABILITY π
This function is available since SDL 3.2.0. so if you're on something older, she's not there yet, sorry queen π
π₯ SEE ALSO π₯
go read those next, they're iconic too, iykyk π
and that's the page!! brought to you by Simple Directmedia Layer π SDL 3.4.18 π mwah, slay, bye bestie πβ¨π¦
π¦ 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