SDL_GPUBlitRegion(3type)
π NAME π
SDL_GPUBlitRegion β it's a struct, bestie, and it describes a region of a texture that you're gonna use in a blit operation. That's the whole vibe. A little rectangle of texture saying "me, this part, right here" π
β¨ SYNOPSIS β¨
#include <SDL3/SDL_gpu.h>
typedef struct SDL_GPUBlitRegion
{
SDL_GPUTexture *texture; /**< The texture. */
Uint32 mip_level; /**< The mip level index of the region. */
Uint32 layer_or_depth_plane; /**< The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures. */
Uint32 x; /**< The left offset of the region. */
Uint32 y; /**< The top offset of the region. */
Uint32 w; /**< The width of the region. */
Uint32 h; /**< The height of the region. */
} SDL_GPUBlitRegion;
π¦ DESCRIPTION π¦
okay so. picture a texture. huge, gorgeous, main character energy. now picture you only want part of it for your blit. that's what this struct is for, and it is so straightforward. let's meet the members one by one, no gatekeeping π«Ά
textureβ the texture. yeah. that's it. that's the field. the actualSDL_GPUTexture *we're talking about πmip_levelβ the mip level index of the region. which level of the mip pyramid are we pulling from, bestie?layer_or_depth_planeβ the layer index or depth plane of the region, and yes the name is long because it does double duty. on 2D array textures and cube textures this value is treated as a layer index. on 3D textures it's treated as a depth plane. one field, two personalities, we love a versatile icon πxβ the left offset of the region. how far in from the left we start πyβ the top offset of the region. how far down from the top we start πwβ the width of the region. how wide our little slice is πhβ the height of the region. how tall our little slice is π
so like, x, y, w, h are just... a rectangle. a rect. the classic. and then texture, mip_level and layer_or_depth_plane tell it which texture and which slice of it you mean. it's giving "I know exactly which part of this texture I want and I'm not settling" π
β¨
πΈ AVAILABILITY πΈ
this struct has been around since SDL 3.2.0. not new new, but not ancient either. it's been here, being useful, minding its business π
π SEE ALSO π
go read those too, they're literally the whole point of this struct existing. iykyk π₯
and that's the page, bestie!! this lil datatype comes to you from Simple Directmedia Layer β that's the source β and the version tag on it is SDL 3.4.18. mwah, go blit 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