SDL_GPUBlendFactor(3type)
π SDL_GPUBlendFactor π
okay bestie, welcome to the SDL3 DATATYPES corner of the manual, where we're talking about SDL_GPUBlendFactor β the enum that decides how much of each thing gets mixed in when you blend. no cap, it's the glow-up recipe for your pixels. β¨
πΈ NAME πΈ
SDL_GPUBlendFactor β specifies a blending factor to be used when pixels in a render target are blended with existing pixels in the texture.
likeβ¦ it literally tells the GPU "hey, how much of the new pixel and how much of the old pixel are we stirring into this smoothie". π₯€
β¨ SYNOPSIS β¨
#include <SDL3/SDL_gpu.h>
typedef enum SDL_GPUBlendFactor
{
SDL_GPU_BLENDFACTOR_INVALID,
SDL_GPU_BLENDFACTOR_ZERO, /**< 0 */
SDL_GPU_BLENDFACTOR_ONE, /**< 1 */
SDL_GPU_BLENDFACTOR_SRC_COLOR, /**< source color */
SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_COLOR, /**< 1 - source color */
SDL_GPU_BLENDFACTOR_DST_COLOR, /**< destination color */
SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_COLOR, /**< 1 - destination color */
SDL_GPU_BLENDFACTOR_SRC_ALPHA, /**< source alpha */
SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, /**< 1 - source alpha */
SDL_GPU_BLENDFACTOR_DST_ALPHA, /**< destination alpha */
SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_ALPHA, /**< 1 - destination alpha */
SDL_GPU_BLENDFACTOR_CONSTANT_COLOR, /**< blend constant */
SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR, /**< 1 - blend constant */
SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE /**< min(source alpha, 1 - destination alpha) */
} SDL_GPUBlendFactor;
π DESCRIPTION π
so the source color is the value written by the fragment shader. that's the new hotness, the fresh fit. π
and the destination color is the value currently existing in the texture. that's the outfit already in your closet, the one that's been there. π
when you blend, these two get combined using a blend factor on each side, and this enum is your menu of factors. iykyk. π
π¦ AVAILABILITY π¦
this enum is available since SDL 3.2.0. it's giving new-ish but very settled. periodt.
π₯ SEE ALSO π₯
bestie reminder: if you're reaching for this enum, you're probably already deep in graphics pipeline territory. hydrate, take a breath, and go read SDL_CreateGPUGraphicsPipeline(3). π«Ά
okay that's the whole vibe, no skips, every single factor accounted for π β this page came to you from Simple Directmedia Layer, running SDL 3.4.18, and it's the SDL_GPUBlendFactor(3type) manual page. stay slaying, go blend something iconic β¨π
π¦ 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