SDL_GETRENDERLOGICALPRESENTATIONRECT(3)
π SDL_GetRenderLogicalPresentationRect(3) π
okay bestie, welcome to the SDL3 FUNCTIONS section of the manual, and today's main character is SDL_GetRenderLogicalPresentationRect π she's a lil getter function and she is literally serving exactly what her name says, no cap.
β¨ NAME β¨
SDL_GetRenderLogicalPresentationRect β get the final presentation rectangle for rendering. π¦
β¨ SYNOPSIS β¨
#include <SDL3/SDL_render.h>
bool SDL_GetRenderLogicalPresentationRect(SDL_Renderer *renderer, SDL_FRect *rect);
β¨ DESCRIPTION β¨
so the way this works is iconic honestly: this function hands you back the calculated rectangle that's being used for logical presentation β and it figures that out based on the presentation mode and the output size. like, it does the math so you don't have to π
and if logical presentation is disabled? she still fills the rectangle for you β with the output size, in pixels. so you're never left hanging with an empty rect, periodt. π
one thing to remember tho: every single render target has its own logical presentation state. so this function? it gets the rectangle for the current render target. not all of them, not the one you're thinking about, the current one. iykyk π«Ά
β¨ FUNCTION PARAMETERS β¨
rendererβ the rendering context. the whole vibe. the main character of the operation. πrectβ a pointer that gets filled in with the final presentation rectangle. and bestie, it may beNULLβ no pressure, she's flexible like that. π
β¨ RETURN VALUE β¨
returns true on success, or false on failure β and if it's giving failure, go call SDL_GetError() for more info, she'll tell you what went wrong. π
β¨ THREAD SAFETY β¨
β οΈ this function should only be called on the main thread. no side quests, no background threads, main thread only. fr fr. π
β¨ AVAILABILITY β¨
this beauty has been available since SDL 3.2.0 β (yes she's new-ish, yes she's thriving πΈ)
β¨ SEE ALSO β¨
SDL_SetRenderLogicalPresentation(3)β the setter to her getter, they're a matched set, obsessed π§
okay that's the whole page bestie, you ate this one ππ
this manual page came to you courtesy of Simple Directmedia Layer, rocking SDL 3.4.18, filed under SDL_GetRender...sentationRect(3) β mwah, slay, bye πβ¨
π¦ 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