SDL_GetDisplayForWindow(3)
β¨ SDL_GetDisplayForWindow β¨
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual π this one's called SDL_GetDisplayForWindow and it's literally here to tell you which display a window is chillin' on. no cap.
π NAME π
SDL_GetDisplayForWindow β get the display associated with a window. periodt.
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_video.h>
SDL_DisplayID SDL_GetDisplayForWindow(SDL_Window *window);
π¦ FUNCTION PARAMETERS π¦
windowβ the window you wanna query. like, the one you're curious about π
π RETURN VALUE π
on success, it returns the instance ID of the display containing the center of the window. (yes, the center, bestie β that's the vibe check that decides everything β¨)
on failure? it returns 0. and if you're sitting there like "why tho π", call SDL_GetError() for more info. she will tell you everything.
π§ THREAD SAFETY π§
this function should only be called on the main thread. do not try her on a side thread, she will not answer. main character energy only, fr fr.
β AVAILABILITY β
this function is available since SDL 3.2.0. iconic behavior, honestly.
π₯ SEE ALSO π₯
Simple Directmedia Layer Β· SDL 3.4.18 Β· SDL_GetDisplayForWindow(3) β that's the whole tea, bestie π«Ά go forth and query those displays, you absolute legend ππ
π¦ 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