SDL_BlitSurfaceTiled(3)
β¨ SDL_BlitSurfaceTiled β¨
okay bestie, welcome to the SDL3 FUNCTIONS section of the manual, page SDL_BlitSurfaceTiled(3), and lemme tell you this one is lowkey iconic π
π NAME π
SDL_BlitSurfaceTiled β do a tiled blit onto a destination surface, and yes it can be a whole different format, we don't gatekeep π«Ά
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_surface.h>
bool SDL_BlitSurfaceTiled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect);
π¦ DESCRIPTION π¦
so the way this works is: the pixels sitting in srcrect get repeated as many times as needed to completely fill dstrect. that's it, that's the whole vibe. it's giving wallpaper. it's giving tiling window manager energy. it literally just keeps stamping that rectangle down until the target is full, periodt β¨
π FUNCTION PARAMETERS π
srcβ theSDL_Surfacestructure you're copying from. the source of truth, the main character πsrcrectβ theSDL_Rectstructure representing the rectangle to be copied. passNULLand it copies the entire surface instead, easy peasy πdstβ theSDL_Surfacestructure that is the blit target. this is where everything lands.dstrectβ theSDL_Rectstructure representing the target rectangle in the destination surface. passNULLand it fills the entire surface. no cap π
π 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 everything π
π₯ THREAD SAFETY π₯
only one thread should be using thesrcanddstsurfaces at any given time. one. single. thread. don't be messy, it's not that kind of party π
π AVAILABILITY π
this function is available since SDL 3.2.0 β
π SEE ALSO π
SDL_BlitSurface(3)β the og, the blueprint, the blueprint fr fr
and that's the whole page bestie!! this has been the Simple Directmedia Layer manual, SDL 3.4.18 edition, SDL_BlitSurfaceTiled(3) β go tile something gorgeous, ily, bye πβ¨ππ¦
π¦ 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