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


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