SDL_GPUBlendOp(3type)

πŸ’– SDL_GPUBlendOp(3type) πŸ’–

okay bestie so this is a page from the SDL3 DATATYPES section of the manual, and it's all about SDL_GPUBlendOp. yes it's a mouthful, no we're not scared of it, let's go ✨


🌸 NAME 🌸

SDL_GPUBlendOp β€” it's the thing that specifies the operator you use when pixels in a render target get blended with pixels that are already chillin' in the texture. like, math but make it fashion πŸ’…


✨ SYNOPSIS ✨

#include <SDL3/SDL_gpu.h>

typedef enum SDL_GPUBlendOp
{
    SDL_GPU_BLENDOP_INVALID,
    SDL_GPU_BLENDOP_ADD,               /**< (source * source_factor) + (destination * destination_factor) */
    SDL_GPU_BLENDOP_SUBTRACT,          /**< (source * source_factor) - (destination * destination_factor) */
    SDL_GPU_BLENDOP_REVERSE_SUBTRACT,  /**< (destination * destination_factor) - (source * source_factor) */
    SDL_GPU_BLENDOP_MIN,               /**< min(source, destination) */
    SDL_GPU_BLENDOP_MAX                /**< max(source, destination) */
} SDL_GPUBlendOp;

like look at that enum. it's giving options. it's giving ✨choices✨. every single one of them, right here, no gatekeeping 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so the lore you actually need, bestie:

  • the source color is the value written by the fragment shader β€” that's the new kid on the block 🌸
  • the destination color is the value that's currently existing in the texture β€” that's the OG that was already there πŸ’–

and SDL_GPUBlendOp is literally just "which math do we do to smoosh these two together." that's it. that's the whole vibe. no cap 🧚


πŸ’… AVAILABILITY πŸ’…

this enum has been around since SDL 3.2.0. so if you're on something older, sorry babes, it's not there 😭


πŸ‘‘ SEE ALSO πŸ‘‘


and that's the page, bestie!! πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«Ά

this one came from the Simple Directmedia Layer crew, in the SDL 3.4.18 era, filed under SDL_GPUBlendOp(3type). mwah. ate. periodt πŸ’œπŸŒˆβ­

πŸ“¦ where this page comes from