SDL_RenderTextureAffine(3)
β¨ SDL_RenderTextureAffine β¨
okay bestie, welcome to the SDL3 FUNCTIONS corner of the SDL_RenderTextureAffine(3) manual, we're doing RENDERING today π
πΈ NAME πΈ
SDL_RenderTextureAffine β copy a portion of the source texture to the current rendering target, with affine transform, at subpixel precision. yes she's fancy, she does math, she slays π
π SYNOPSIS π
#include <SDL3/SDL_render.h>
bool SDL_RenderTextureAffine(SDL_Renderer *renderer, SDL_Texture *texture,
const SDL_FRect *srcrect, const SDL_FPoint *origin,
const SDL_FPoint *right, const SDL_FPoint *down);
π¦ FUNCTION PARAMETERS π¦
rendererβ the renderer which should copy parts of a texture. she's the one doing the work, give her credit πtextureβ the source texture. the pic we're pulling from, the main character of the operation β¨srcrectβ a pointer to the source rectangle, orNULLfor the entire texture. like, "just give me this lil chunk" or "no thoughts, whole texture" πoriginβ a pointer to a point indicating where the top-left corner ofsrcrectshould be mapped to, orNULLfor the rendering target's origin. where the top-left lands, basically πΈrightβ a pointer to a point indicating where the top-right corner ofsrcrectshould be mapped to, orNULLfor the rendering target's top-right corner. top-right go here, periodt πdownβ a pointer to a point indicating where the bottom-left corner ofsrcrectshould be mapped to, orNULLfor the rendering target's bottom-left corner. bottom-left destination, that's the vibe π¦
ngl the way this works is: you hand her three corners and she does the affine thing with them. top-left, top-right, bottom-left. the fourth one is implied. geometry ate, no cap π
β RETURN VALUE β
Returns true on success or false on failure; call SDL_GetError() for more information.
so like. if it returns false, do NOT just sit there, go call SDL_GetError() and find out what happened, bestie π
π THREAD SAFETY π
You may only call this function from the main thread.
like, respectfully, do not try to be cute and call her from a worker thread. she is not about that life π«π§΅
π AVAILABILITY π
This function is available since SDL 3.2.0.
so if you're on something older, that's a skill issue on your SDL version, upgrade fr fr β¬οΈ
π SEE ALSO π
(the non-affine sister function, she's iconic too, go say hi π«Ά)
that's the whole page!! every flag, every corner, every NULL default, all of it preserved with love π this cutie comes to you courtesy of Simple Directmedia Layer, SDL 3.4.18, and it's filed under the SDL_RenderTextureAffine(3) header in the SDL3 FUNCTIONS section. go forth and transform your textures affinely, babe πβ¨π
π¦ 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