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