extrans(3)

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

✨ extrans(3) β€” the Allegro manual's lil' glow-up demo ✨

okay bestie, so this one is a page from the Allegro manual, and it's all about extrans β€” the lighting and translucency effects situation. πŸ’‘βœ¨ Allegro game programming library, periodt.


🌸 SYNOPSIS 🌸

#include <allegro.h>

Example extrans

πŸ’– DESCRIPTION πŸ’–

So this program is literally a demo of how to use the lighting and translucency functions, and it's giving main character energy from start to finish. 🫢

Part one: you get a dark screen, right? Total void. And then a spotlight illuminates it, and you can move that spotlight around with your mouse. πŸ–±οΈβœ¨ Obsessed.

Part two: after a key press, the example switches it up and shows you the full bitmap, and the spotlight transforms β€” it becomes a reduced version of the background with 50% of translucency. πŸ’… The glow-up is real.

Now for the technical tea, and this part matters so don't scroll past it:

  • The translucency effect is easy to do in all color depths. No cap, all of them. πŸŽ€
  • But the lighting effect has to be performed in a different way depending on whether the screen is in 8bit mode or another color depth. ⚠️

And why, you ask? Because additive drawing mode uses a different set of routines for truecolor modes. That's the whole reason. iykyk. 🌈


πŸ‘‘ SEE ALSO πŸ‘‘

The whole friend group, fr fr β€” every single one of them:


and that's the whole page, bestie πŸ¦‹ this one came from the Allegro manual, version 4.4.3 β€” mwah, iconic, no notes. πŸ’œπŸŽ€

πŸ“¦ where this page comes from