SDL_RenderTexture9GridTiled(3)
β¨ SDL_RenderTexture9GridTiled(3) β¨
okay bestie, welcome to the SDL3 FUNCTIONS corner of the man pages π this one's a SDL_RenderTexture9GridTiled situation and it's genuinely so satisfying once it clicks.
πΈ NAME πΈ
SDL_RenderTexture9GridTiled β do a scaled copy onto the current rendering target using the 9-grid algorithm, at subpixel precision β¨
π SYNOPSIS π
#include <SDL3/SDL_render.h>
bool SDL_RenderTexture9GridTiled(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, float left_width, float right_width, float top_height, float bottom_height, float scale, const SDL_FRect *dstrect, float tileScale);
π¦ DESCRIPTION π¦
so the pixels in your texture get chopped into a 3x3 grid, right? each corner uses its own corner size, and the sides + center are whatever pixels are left over. then the corners get scaled using scale and fitted into the corners of the destination rectangle. after that, the sides and the center get tiled into place to cover the rest of the destination rectangle. it's giving wallpaper energy fr fr π§
π FUNCTION PARAMETERS π
rendererβ the renderer that's gonna copy parts of a texture. that's its whole job.textureβ the source texture. the material, the moment, the main character πsrcrectβ theSDL_Rectstructure representing the rectangle used for the 9-grid, orNULLto use the entire texture.left_widthβ the width, in pixels, of the left corners insrcrect.right_widthβ the width, in pixels, of the right corners insrcrect.top_heightβ the height, in pixels, of the top corners insrcrect.bottom_heightβ the height, in pixels, of the bottom corners insrcrect.scaleβ the scale used to transform the corner ofsrcrectinto the corner ofdstrect, or0.0ffor an unscaled copy.dstrectβ a pointer to the destination rectangle, orNULLfor the entire rendering target.tileScaleβ the scale used to transform the borders and center ofsrcrectinto the borders and middle ofdstrect, or1.0ffor an unscaled copy.
π RETURN VALUE π
returns true on success or false on failure β and if it fails, call SDL_GetError() for more info. no cap, always check π
β THREAD SAFETY β
this function should only be called on the main thread. periodt. don't try it anywhere else π
π AVAILABILITY π
this function is available since SDL 3.4.0. iconic behavior.
π₯ SEE ALSO π₯
and that's the whole page, bestie π«Ά this was Simple Directmedia Layer, SDL 3.4.18, and yes the footer said SDL_RenderTexture9GridTiled(3) too, so we're full circle π mwah, go tile something gorgeous β¨
π¦ 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