SDL_SetRenderColorScale(3)
π SDL_SetRenderColorScale π
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, this one's a lil glow-up function and it's literally called SDL_SetRenderColorScale(3) β¨
πΈ NAME πΈ
SDL_SetRenderColorScale β set the color scale used for render operations. that's it, that's the whole vibe π
β¨ SYNOPSIS β¨
#include <SDL3/SDL_render.h>
bool SDL_SetRenderColorScale(SDL_Renderer *renderer, float scale);
π DESCRIPTION π
so the color scale is like, an extra scale that gets multiplied into the pixel color value while you're rendering. it's a whole extra layer of math happening on your colors, and she's doing the most π«Ά
what's it for? two main girlboss use cases:
- adjusting the brightness of colors during HDR rendering π
- changing HDR video brightness when you're playing on an SDR display π
and the important part, the part you cannot skip, the part that's giving boundaries: the color scale does not touch the alpha channel. nope. not even a little. it only affects the color brightness, periodt. alpha stays exactly where she is π
π¦ FUNCTION PARAMETERS π¦
rendererβ the rendering context. your whole render situation, the main character π¬scaleβ the color scale value. afloat, and this is the number doing the multiplying β¨
π RETURN VALUE π
returns true on success or false on failure π β and if it fails, bestie, call SDL_GetError() for more information, she'll tell you what went wrong fr fr
π§ THREAD SAFETY π§
β οΈ this function should only be called on the main thread. no side-quest threads on this one, okay? main thread only. don't try it. i'm watching π
β AVAILABILITY β
this function is available since SDL 3.2.0 β so if you're on something older than that, no she's not here yet, you gotta update πΈ
π SEE ALSO π
SDL_GetRenderColorScale(3)β the lil sister function that reads the value back out, the way that they're a matching set, obsessed π
and that's the whole page, you ate that π go forth and scale your colors responsibly, iykyk πβ¨
Simple Directmedia Layer β SDL 3.4.18 β and yeah, SDL_SetRenderColorScale(3) is the one and only, mwah π
ππ¦
π¦ 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