SDL_GETCURRENTRENDEROUTPUTSIZE(3)
π SDL_GetCurrentRenderOutputSize(3) π
okay bestie, welcome to the SDL3 FUNCTIONS section of the manual, and today's main character is SDL_GetCurrentRenderOutputSize β¨ she's a lil function that tells you how big your render output actually is, in pixels. no cap.
πΈ NAME πΈ
SDL_GetCurrentRenderOutputSize β get the current output size in pixels of a rendering context πΌοΈ
β¨ SYNOPSIS β¨
#include <SDL3/SDL_render.h>
bool SDL_GetCurrentRenderOutputSize(SDL_Renderer *renderer, int *w, int *h);
π¦ DESCRIPTION π¦
okay so here's the tea β if a rendering target is active, this function hands you back the size of that rendering target, measured in pixels. and if there's no rendering target active? then it just gives you whatever SDL_GetRenderOutputSize() says. either way you're getting an answer, she's not gonna leave you on read π
and listen β rendering target or not, the output gets adjusted by the current logical presentation state, which is dictated by SDL_SetRenderLogicalPresentation(). so like, the logical presentation vibe check happens regardless. periodt.
π FUNCTION PARAMETERS π
rendererβ the rendering context. that's your girl. the whole point. πwβ a pointer that gets filled in with the current width πhβ a pointer that gets filled in with the current height π
π₯ RETURN VALUE π₯
returns true on success, or false on failure π and if it fails, pls call SDL_GetError() for more info, she'll tell you what went wrong fr fr.
π§ THREAD SAFETY π§
β οΈ this function should only be called on the main thread. no sneaking off to a background thread with this one, bestie. main character energy only, and the main thread is the main character π
β AVAILABILITY β
this function is available since SDL 3.2.0 ποΈ so if you're on anything older, sorry babe, she doesn't exist yet π
π SEE ALSO π
and that's the whole page π«Ά shoutout to Simple Directmedia Layer, this is SDL 3.4.18, and yeah the header/footer keep trying to truncate the function name like SDL_GetCurren...derOutputSize(3) which is honestly giving "character limit on the group chat name" π anyway ily, go render something iconic, mwah πβ¨π
π¦ 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