_set_color(3)

πŸ“¦ version 4.4.3.1, in fedora 43, fedora 44

✨ _set_color ✨

okay bestie, so this is a page from the Allegro manual β€” the Allegro game programming library, if you're new here πŸŽ€ β€” and we're talking about _set_color, the inline little sister of set_color(). she's fast, she's specific, and she has ✨opinions✨ about where she's allowed to be used. let's get into it πŸ’…


🌸 SYNOPSIS 🌸

#include <allegro.h>

void _set_color(int index, const RGB *p);

πŸ’– DESCRIPTION πŸ’–

So. _set_color() is literally just the inline version of set_color() 🫢. She exists for one reason and one reason only: to be called from inside the vertical retrace simulator callback function β€” that's retrace_proc, which is, and I cannot stress this enough, deprecated 😭. like, girl, she's retired, we don't do that anymore.

ok but if you really, truly, absolutely must call _set_color from retrace_proc, here's the tea: it should only be used under DOS, and only in VGA mode 13h and mode-X. no exceptions, no vibes-based workarounds.

And why, you ask? πŸ¦‹ because some SVGA chipsets aren't VGA compatible. On those cards, set_color() and set_palette() will go ahead and use VESA calls to do their thing β€” but _set_color()? she literally doesn't know about that πŸ’€. no VESA fallback, no plan B. so yeah, that's the whole situation. iconic behavior, honestly.


πŸ”₯ SEE ALSO πŸ”₯


and that's the page, bestie πŸ’œ go forth and set your colors responsibly (or don't, but like, know the risks). this has been brought to you by Allegro, version 4.4.3 ⭐ β€” mwah, stay slaying πŸŽ€πŸ’…βœ¨

πŸ“¦ where this page comes from