SDL_GETRENDERLOGICALPRESENTATION(3)
π SDL_GetRenderLogicalPresentation β the SDL3 FUNCTIONS manual page, bestie edition π
okay so real talk, you're in the SDL3 FUNCTIONS corner of the manual and this little function is about to tell you how big your logical rendering canvas actually is. no cap. let's get into it π¦
β¨ NAME β¨
SDL_GetRenderLogicalPresentation β get the device independent resolution and presentation mode you're using for rendering. it's giving "read the receipts" energy, fr fr π
β¨ SYNOPSIS β¨
#include <SDL3/SDL_render.h>
bool SDL_GetRenderLogicalPresentation(SDL_Renderer *renderer, int *w, int *h, SDL_RendererLogicalPresentation *mode);
like, one line of C, four arguments, zero drama πΈ
β¨ DESCRIPTION β¨
so the way this works: this function gets the width and height of the logical rendering output, or 0 if a logical resolution is not enabled. that's the whole vibe check right there π
and here's the part that's lowkey important: each render target has its own logical presentation state. so this function? it gets the state for the current render target. not all of them. the one you're on right now. main character energy only π
β¨ FUNCTION PARAMETERS β¨
rendererβ the rendering context. you know, the whole operation πwβ anintfilled with the logical presentation width.hβ anintfilled with the logical presentation height.modeβ a variable filled with the logical presentation mode being used. so it literally hands you back which mode you're in, iconic π
β¨ RETURN VALUE β¨
Returns true on success or false on failure. and if it fails? call SDL_GetError() for more information, bestie. she'll tell you what went wrong π«Ά
β¨ THREAD SAFETY β¨
β οΈ okay listen. this function should only be called on the main thread. do not try to be cute and call it from a worker thread. i'm serious π
β¨ AVAILABILITY β¨
this function is available since SDL 3.2.0. so if you're on anything older, sorry babe, no logical presentation for you π
β¨ SEE ALSO β¨
SDL_SetRenderLogicalPresentation(3)β the setter to this getter. they're a matching set, you know the vibe π§
Simple Directmedia Layer Β· SDL 3.4.18 β that's the source and version, babes, and this lil page is SDL_GetRender...lPresentation(3). mwah, go render something cute πβ¨π
π¦ 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