set_color(3)
β¨ set_color(3) β¨
okay bestie, welcome to the Allegro manual π this one's a little guy but it's IMPORTANT, so let's go π«Ά
πΈ NAME πΈ
set_color β sets the specified palette entry to the specified RGB triplet. it's giving Allegro game programming library energy π
π SYNOPSIS π
#include <allegro.h>
void set_color(int index, const RGB *p);
π¦ DESCRIPTION π¦
okay so, set_color sets the specified palette entry to the specified RGB triplet. that's the whole vibe, literally. you hand it an index and a pointer to an RGB, and it slots that colour right into your palette π¨
BUT β and this is the part where you gotta pay attention, no cap β unlike the other palette functions, this one does NOT do any retrace synchronisation π so if you just raw-dog it mid-frame you're gonna get snow problems on your screen. the fix? call vsync() before it, and you're golden β¨
example, bestie:
RGB rgb;
...
vsync();
set_color(192, &rgb);
see how the vsync() comes first? that's the whole trick, iykyk π
π SEE ALSO π
and that's the whole page, periodt π this was the Allegro manual, version 4.4.3 β mwah, go make something pretty with it ππ§π
π¦ 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