SDL_BlendOperation(3type)
π SDL_BlendOperation π
okay bestie, welcome to the SDL3 DATATYPES section of the manual, and today we're decoding SDL_BlendOperation β literally just the enum that decides how your source pixels and your destination pixels get mashed together when you blend. that's it, that's the whole vibe. no cap. π
β¨ NAME β¨
SDL_BlendOperation β the blend operation used when combining source and destination pixel components. it's giving "math but make it fashion" π
πΈ SYNOPSIS πΈ
first things first, you gotta pull in the header:
#include <SDL3/SDL_blendmode.h>
and here's the enum in all its glory, exactly as it lives in the source, comments and all, because we do not edit the queen's handwriting:
typedef enum SDL_BlendOperation
{
SDL_BLENDOPERATION_ADD = 0x1, /**< dst + src: supported by all renderers */
SDL_BLENDOPERATION_SUBTRACT = 0x2, /**< src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan */
SDL_BLENDOPERATION_REV_SUBTRACT = 0x3, /**< dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan */
SDL_BLENDOPERATION_MINIMUM = 0x4, /**< min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan */
SDL_BLENDOPERATION_MAXIMUM = 0x5 /**< max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan */
} SDL_BlendOperation;
π¦ the values, one by one π¦
SDL_BLENDOPERATION_ADDβ value0x1. doesdst + src. the people's champion, supported by all renderers. no exclusivity, no drama, everybody's invited to this party π«ΆSDL_BLENDOPERATION_SUBTRACTβ value0x2. doessrc - dst. supported byD3D,OpenGL,OpenGLES, andVulkan. ok so read that order carefully bestie, it's src minus dst, not the other way around πSDL_BLENDOPERATION_REV_SUBTRACTβ value0x3. doesdst - src. supported byD3D,OpenGL,OpenGLES, andVulkan. it's the reverse subtract, hence the name, the "rev" is doing a lot of heavy lifting here and honestly, good for it β¨SDL_BLENDOPERATION_MINIMUMβ value0x4. doesmin(dst, src). supported byD3D,OpenGL,OpenGLES, andVulkan. keeps whichever one is smaller, like when you and your bestie are picking a movie and you go with the shorter one because it's already late πSDL_BLENDOPERATION_MAXIMUMβ value0x5. doesmax(dst, src). supported byD3D,OpenGL,OpenGLES, andVulkan. keeps whichever one is bigger. main character energy, obviously π
β οΈ real talk for one sec: onlySDL_BLENDOPERATION_ADDis listed as supported by all renderers. the other four are only listed forD3D,OpenGL,OpenGLES, andVulkan. so if you're out here on some other backend, that's a vibe check you need to run yourself π
π AVAILABILITY π
this enum is available since SDL 3.2.0. so if you're on anything older, it's not ghosting you, it literally does not exist yet π
and that's the whole page, bestie, you ate it up fr fr π
this was SDL_BlendOperation(3type) from the Simple Directmedia Layer, documented as of SDL 3.4.18 β go forth and blend responsibly, ily, bye π§β¨
π¦ 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