SDL_GETCURRENTDISPLAYORIENTATION(3)

✨ SDL_GetCurrentDisplayOrientation ✨

okay bestie, gather round, because we're doing the SDL3 man page thing πŸ’– this one lives in the SDL3 FUNCTIONS section and it's literally called SDL_GetCurrentDisplayOrientation β€” say that five times fast, i dare you 🫢


🌸 NAME 🌸

SDL_GetCurrentDisplayOrientation β€” get the orientation of a display.

like, which way is it facing, bestie. portrait? landscape? the whole vibe check πŸ“±πŸ”„


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_video.h>

SDL_DisplayOrientation SDL_GetCurrentDisplayOrientation(SDL_DisplayID displayID);

ok so you pull in <SDL3/SDL_video.h> and then you call it, and it hands you back an SDL_DisplayOrientation. simple. clean. iconic ✨


πŸ¦‹ FUNCTION PARAMETERS πŸ¦‹

  • displayID β€” the instance ID of the display you wanna query. yes, the instance ID, not the index, not the name, the ID πŸͺͺ you get these from the display functions, iykyk.

πŸ’… RETURN VALUE πŸ’…

it returns the SDL_DisplayOrientation enum value of the display. that's it, that's the tea β˜•

but if it isn't available? it gives you SDL_ORIENTATION_UNKNOWN instead. so like, don't just assume you got a real answer β€” check for that unknown, bestie, or you're gonna have a bad time 😭


πŸ”₯ THREAD SAFETY πŸ”₯

this function should only be called on the main thread. periodt. no side-quest threads, no background chaos, main character thread only πŸ‘‘

🌈 AVAILABILITY 🌈

this function is available since SDL 3.2.0. if you're on something older, sorry babe, it's not there πŸ™ˆ


⭐ SEE ALSO ⭐

  • SDL_GetDisplays(3) β€” go get yourself some display IDs first, you're gonna need 'em πŸ’œ

and that's the whole page, no cap πŸŽ€ every flag, every param, every return value, all accounted for, we ate and left no crumbs πŸ’…

mwah πŸ’– this page came to you from Simple Directmedia Layer, SDL 3.4.18, and yes the header up top says SDL_GetCurren...ayOrientation(3) because terminals are dramatic and truncate things. stay oriented, bestie 🧚

πŸ“¦ where this page comes from