SDL_GetRenderScale(3)
β¨ SDL_GetRenderScale β¨
okay bestie, welcome to the SDL_GetRenderScale(3) page from the SDL3 FUNCTIONS squad π lowkey one of the cutest little getters in the whole render API. let's get into it.
πΈ NAME πΈ
SDL_GetRenderScale β get the drawing scale for the current target. that's it. that's the whole job. iconic behavior honestly π
π SYNOPSIS π
#include <SDL3/SDL_render.h>
bool SDL_GetRenderScale(SDL_Renderer *renderer, float *scaleX, float *scaleY);
look at her. three params. returns a bool. no drama, no cap π«Ά
π¦ DESCRIPTION π¦
okay so here's the tea: every single render target has its own scale. like, its own personal vibe. this function gets the scale for the current render target β nothing more, nothing less.
so whatever target you're currently drawing into? that's whose scale you're asking about. not some other target. the current one. periodt β¨
π FUNCTION PARAMETERS π
rendererβ the rendering context. your main character π¬scaleXβ a pointer that gets filled in with the horizontal scaling factor. left-to-right energy πscaleYβ a pointer that gets filled in with the vertical scaling factor. up-and-down energy β
π RETURN VALUE π
returns true on success or false on failure β and if it fails, bestie, call SDL_GetError() for more information. she will tell you what went wrong, fr fr π
π₯ THREAD SAFETY π₯
this function should only be called on the main thread. do not be cute about it. do not try to sneak it onto a worker thread. main thread only, no exceptions, that's the rule π
π AVAILABILITY π
this function is available since SDL 3.2.0. she's not ancient, she's fresh π
π§ SEE ALSO π§
SDL_SetRenderScale(3)β the other half of the duo, the one who sets the scale. you'll wanna check her out too π
and that's the page!! mwah π
cute lil sign-off: this is from Simple Directmedia Layer, the manual itself is at version SDL 3.4.18, and the page is SDL_GetRenderScale(3). go forth and scale responsibly, queen πβ¨
π¦ 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