set_palette_range(3)
β¨ NAME β¨
okay so this is set_palette_range(3), straight out of the Allegro manual π β and it does exactly one iconic thing: it sets a specific range of the palette. no cap.
set_palette_range β Sets a specific range of the palette. Allegro game programming library.
π SYNOPSIS π
#include <allegro.h>
void set_palette_range(const PALETTE p, int from, int to, int vsync);
π¦ DESCRIPTION π¦
bestie, listen. this function sets the palette entries between from and to β and yes, inclusive, so both endpoints get changed too π
. if you wanna set the entire palette, you pass 0 and 255. periodt.
now about vsync: if it's set, the function waits for the vertical retrace before doing its thing. if it's not set, it sets the colors immediately. no waiting, no drama, just colors. β¨
example time, because seeing it is believing:
PALETTE palette;
...
/* Modify the first 16 entries. */
change_first_16_colors(palette);
/* Now update them waiting for vsync. */
set_palette_range(palette, 0, 15, 1);
likeβ¦ the way that it updates entries 0 through 15 and waits for vsync? obsessed. π«Ά
πΈ SEE ALSO πΈ
and that's the whole vibe check, bestie. go forth and palette responsibly π
Allegro version 4.4.3 β set_palette_range(3) β mwah, slay, bye ππ
β¨
π¦ where this page comes from
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms