SDL_SetGamma(3)
π SDL_SetGamma(3) π
okay bestie, welcome to the SDL API Reference β we're doing SDL_SetGamma today and honestly? it's giving brightness slider but make it β¨scienceβ¨.
πΈ NAME πΈ
SDL_SetGamma β sets the color gamma function for the display π
β¨ SYNOPSIS β¨
#include "SDL.h"
int SDL_SetGamma(float redgamma, float greengamma, float bluegamma);
π¦ DESCRIPTION π¦
so what this does is it sets the "gamma function" for the display of each color component. and what IS gamma, you ask? it's the thing that controls the brightness/contrast of the colors showing up on your screen. a gamma value of 1.0 is the identity β meaning literally no adjustment happens, you get exactly what you put in. periodt. π
this function adjusts the gamma based on that "gamma function" parameter. but bestie, if you want to go full control-freak mode and directly specify lookup tables for your gamma adjustment, that's what SDL_SetGammaRamp is for. different vibe, same glow-up energy. β¨
β οΈ heads up: not all display hardware is able to change gamma. some screens simply said "no π" and there is nothing you can do about it.
π«Ά RETURN VALUE π«Ά
returns -1 on error β or if gamma adjustment just isn't supported by your hardware at all. so yeah, -1 is the "it didn't work, bestie π" signal.
π SEE ALSO π
SDL_GetGammaRampSDL_SetGammaRamp
and that's the whole page, gorgeous π this one came straight out of the SDL library, dated Tue 11 Sep 2001, 23:01 β a true vintage icon, and you just read the entire thing. slay πβ¨π
π¦ where this page comes from
- debian bookworm: libsdl1.2-dev 1.2.15+dfsg2-8 Β· LGPL-2.1-or-later
- nixos 26.05: SDL_sixel 0-unstable-2016-02-06
- nixpkgs unstable: SDL_sixel 0-unstable-2016-02-06
- ubuntu jammy: libsdl1.2-dev 1.2.15+dfsg2-6 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms