SDL_GPUTextureRegion(3type)
β¨ SDL_GPUTextureRegion β¨
okay bestie, welcome to the SDL_GPUTextureRegion page β it's a SDL3 DATATYPES moment, and honestly? it's giving "small struct, big responsibilities". π
πΈ NAME πΈ
SDL_GPUTextureRegion β a structure specifying a region of a texture. literally just a lil rectangle (or box, we love a 3D queen π) inside a texture. that's it. that's the vibe.
π¦ SYNOPSIS π¦
#include <SDL3/SDL_gpu.h>
typedef struct SDL_GPUTextureRegion
{
SDL_GPUTexture *texture; /**< The texture used in the copy operation. */
Uint32 mip_level; /**< The mip level index to transfer. */
Uint32 layer; /**< The layer index to transfer. */
Uint32 x; /**< The left offset of the region. */
Uint32 y; /**< The top offset of the region. */
Uint32 z; /**< The front offset of the region. */
Uint32 w; /**< The width of the region. */
Uint32 h; /**< The height of the region. */
Uint32 d; /**< The depth of the region. */
} SDL_GPUTextureRegion;
like. look at her. nine fields, zero drama. π
π DESCRIPTION π
Used when transferring data to or from a texture. that's the whole plot fr fr β you're pointing at a specific slice of a texture so the GPU knows exactly which pixels you mean. no guessing, no "eh just copy the whole thing". you're being precise, and honestly? iconic.
π AVAILABILITY π
This struct is available since SDL 3.2.0. so if you're on anything older, bestie... no she is not there yet π
π SEE ALSO π
SDL_UploadToGPUTexture(3)β the "get this data INTO the texture" bestie π«ΆSDL_DownloadFromGPUTexture(3)β the "get this data OUT of the texture" bestie π«ΆSDL_CreateGPUTexture(3)β where the texture itself comes from β¨SDL_GPUTexture(3type)β the texture type this region lives inside πΈ
and that's the whole page, bestie!! this lil love letter to the GPU was brought to you by Simple Directmedia Layer, SDL 3.4.18 edition β mwah, go forth and copy textures responsibly πβ¨ππ¦πΈπ π«Ά
π¦ 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