SDL_SetGPUBlendConstants(3)

πŸ’– SDL_SetGPUBlendConstants β€” NAME, bestie πŸ’–

okay so this page is SDL_SetGPUBlendConstants(3), part of the SDL3 functions fam, and it does exactly one iconic thing: it sets the current blend constants on a command buffer. that's it. that's the whole job. she's focused, she's simple, she ate. πŸŽ€


✨ SYNOPSIS ✨

first you gotta bring her into the group chat:

#include <SDL3/SDL_gpu.h>

then the actual call, verbatim, no cap:

void SDL_SetGPUBlendConstants(
    SDL_GPURenderPass *render_pass,
    SDL_FColor blend_constants);

notice the void? she returns nothing. no notes, no receipts, no return value. she just does the thing and moves on. main character energy fr fr. πŸ’…


🌸 FUNCTION PARAMETERS 🌸

two args, both important, let's get into it:

  • render_pass β€” a render pass handle. this is the render pass you're working inside, the whole venue for the vibe. lowkey important.
  • blend_constants β€” the blend constant color. it's an SDL_FColor, so it's the color the blending math is gonna reference. that's the constant, bestie.

that's the whole parameter list. short, sweet, slay.


πŸ¦‹ AVAILABILITY πŸ¦‹

she's been around since SDL 3.2.0. if your SDL is older than that, no SDL_SetGPUBlendConstants for you, sorry bestie 😭

πŸ‘‘ SEE ALSO πŸ‘‘

these are the two blend factors that actually use the constants you just set, so like, they're the whole reason this function exists. obsessed:

  • SDL_GPU_BLENDFACTOR_CONSTANT_COLOR(3)
  • SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR(3)

if you're setting blend constants, you're almost definitely using one of these two. iykyk. 🌈


and that's the whole page, bestie ✨ this was SDL_SetGPUBlendConstants(3), brought to you by Simple Directmedia Layer, version SDL 3.4.18 β€” go forth and blend, you absolute icon πŸ«ΆπŸ’œ

πŸ“¦ where this page comes from