SDL_GPUStencilOp(3type)

✨ SDL_GPUStencilOp ✨

okay bestie, welcome to the SDL_GPUStencilOp page πŸ’– this is one of those SDL3 DATATYPES moments, and honestly? it's giving "tiny enum, huge consequences."

So like, what even is this? It's the enum that says what happens to a stored stencil value when the stencil tests go one way or the other β€” fail or pass. That's it. That's the whole vibe check. πŸŽ€


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_gpu.h>

typedef enum SDL_GPUStencilOp
{
    SDL_GPU_STENCILOP_INVALID,
    SDL_GPU_STENCILOP_KEEP,                 /**< Keeps the current value. */
    SDL_GPU_STENCILOP_ZERO,                 /**< Sets the value to 0. */
    SDL_GPU_STENCILOP_REPLACE,              /**< Sets the value to reference. */
    SDL_GPU_STENCILOP_INCREMENT_AND_CLAMP,  /**< Increments the current value and clamps to the maximum value. */
    SDL_GPU_STENCILOP_DECREMENT_AND_CLAMP,  /**< Decrements the current value and clamps to 0. */
    SDL_GPU_STENCILOP_INVERT,               /**< Bitwise-inverts the current value. */
    SDL_GPU_STENCILOP_INCREMENT_AND_WRAP,   /**< Increments the current value and wraps back to 0. */
    SDL_GPU_STENCILOP_DECREMENT_AND_WRAP    /**< Decrements the current value and wraps to the maximum value. */
} SDL_GPUStencilOp;

πŸ‘‘ DESCRIPTION πŸ‘‘

okay so picture this: the stencil test just ran, and it either passed or it flopped. What do we do with the value we've got stored? That's the question this enum answers, and ngl it has range. Every option, in order, no skips, we're doing all of them because we are thorough queens πŸ’…

  • SDL_GPU_STENCILOP_INVALID β€” the placeholder / "nothing was set" situation. it's just sitting there first in the list, being invalid. πŸ’€
  • SDL_GPU_STENCILOP_KEEP β€” literally leaves the current value exactly as it is. no notes. keeps the current value. periodt.
  • SDL_GPU_STENCILOP_ZERO β€” sets the value to 0. zero. nada. reset arc. 🌈
  • SDL_GPU_STENCILOP_REPLACE β€” sets the value to reference. (yes, the reference. that's what it says.) ✨
  • SDL_GPU_STENCILOP_INCREMENT_AND_CLAMP β€” increments the current value and clamps to the maximum value. so it goes up, but it will NOT go past the ceiling, bestie. it knows its limits. 🫢
  • SDL_GPU_STENCILOP_DECREMENT_AND_CLAMP β€” decrements the current value and clamps to 0. down it goes, but it stops at zero, no negative energy allowed. πŸ™ˆ
  • SDL_GPU_STENCILOP_INVERT β€” bitwise-inverts the current value. flips every bit, full main character transformation. πŸ”₯
  • SDL_GPU_STENCILOP_INCREMENT_AND_WRAP β€” increments the current value and wraps back to 0. goes up, hits the top, and just... teleports home. πŸ¦‹
  • SDL_GPU_STENCILOP_DECREMENT_AND_WRAP β€” decrements the current value and wraps to the maximum value. goes down past 0 and reappears at the max, iconic behaviour honestly. ⭐

πŸ’œ AVAILABILITY πŸ’œ

This enum is available since SDL 3.2.0. so if you're on something older... bestie, upgrade. 😭


πŸ” SEE ALSO πŸ”


and that's the page!! stay slay, keep your stencil values exactly where you want them, and remember: clamp is for girls who respect boundaries and wrap is for girls who live on the edge πŸ’…βœ¨

this cutie was brought to you by Simple Directmedia Layer β€” SDL 3.4.18 β€” and the page itself is SDL_GPUStencilOp(3type). mwah πŸŽ€

πŸ“¦ where this page comes from