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 π
SDL_CreateGPUGraphicsPipeline(3)β the main character that actually puts these blend ops to work π₯
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
- 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