SDL_GetTextureSize(3)
β¨ SDL_GetTextureSize β¨
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where we're talking about SDL_GetTextureSize π
πΈ NAME πΈ
SDL_GetTextureSize β get the size of a texture, as floating point values. yes literally that's the whole vibe, it tells you how big your texture is π¦
π SYNOPSIS π
#include <SDL3/SDL_render.h>
bool SDL_GetTextureSize(SDL_Texture *texture, float *w, float *h);
π FUNCTION PARAMETERS π
textureβ the texture you're querying. the one you wanna know the size of, the main character of this whole operation πwβ a pointer that gets filled in with the width of the texture, in pixels. and here's the cute part: this argument can beNULLif you don't need this info π«Ά so if you only care about height, you can just yeet aNULLin there, no big dealhβ a pointer that gets filled in with the height of the texture, in pixels. same deal, this argument can beNULLif you don't need this information πΈ
β RETURN VALUE β
Returns true on success or false on failure β and if it fails, call SDL_GetError() for more information, she'll tell you what went wrong π
π₯ THREAD SAFETY π₯
This function should only be called on the main thread. no cap, do not try to be sneaky about this one π
π AVAILABILITY π
This function is available since SDL 3.2.0. it's giving established, it's giving iconic, periodt β¨
and that's the whole page bestie, you ate that ππ
this lil love letter to your codebase comes to you courtesy of Simple Directmedia Layer, running version SDL 3.4.18 β SDL_GetTextureSize(3), out here doing the most so your textures never have to guess their own size ππ¦π
π¦ 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