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 πŸ‘‘


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