SDL_GPUSAMPLERADDRESSMODE(3type)
β¨ NAME β¨
SDL_GPUSamplerAddressMode β the enum that tells your GPU sampler what to do when the texture coordinates go off the edge of the 0-1 range π¦
Like, picture a texture living happily in 0.0 to 1.0 land, and then someone hands it a -3.7 or a 42.0. Bestie, it panics. This enum is the vibe check that stops the panic. π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_gpu.h>
typedef enum SDL_GPUSamplerAddressMode
{
SDL_GPU_SAMPLERADDRESSMODE_REPEAT, /**< Specifies that the coordinates will wrap around. */
SDL_GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT, /**< Specifies that the coordinates will wrap around mirrored. */
SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE /**< Specifies that the coordinates will clamp to the 0-1 range. */
} SDL_GPUSamplerAddressMode;
So it's a typedef enum called SDL_GPUSamplerAddressMode and it lives in <SDL3/SDL_gpu.h> β go grab it from there, don't be weird about it. π
π the values, one by one π
SDL_GPU_SAMPLERADDRESSMODE_REPEATβ the coordinates wrap around. Tiles forever, main character energy, no gaps, no drama. πSDL_GPU_SAMPLERADDRESSMODE_MIRRORED_REPEATβ the coordinates wrap around mirrored. Same tiling but every other copy is flipped, so the seams literally cannot be caught looking messy. πͺSDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGEβ the coordinates clamp to the 0-1 range. Anything past the edge just... grabs the edge pixel and holds on for dear life. No wrap, no mirror, just cling. π«Ά
π AVAILABILITY π
This enum has been serving looks since SDL 3.2.0. Iconic behavior, truly. π
π SEE ALSO π
SDL_CreateGPUSampler(3)β the function where you actually use this enum, iykyk π₯
Okay that's the whole page, bestie, go make something pretty. π
Shoutout to Simple Directmedia Layer for this one, sitting pretty at SDL 3.4.18 βSDL_GPUSamplerAddressMode(3type),SDL3 DATATYPES. No cap. π
π¦ 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