extrans(3)
β¨ 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:
BITMAP(3)COLOR_MAP(3)END_OF_MAIN(3)PALETTE(3)RGB(3)RGB_MAP(3)SCREEN_H(3)SCREEN_W(3)allegro_error(3)allegro_init(3)allegro_message(3)bitmap_color_depth(3)blit(3)circlefill(3)clear_bitmap(3)clear_keybuf(3)color_map(3)create_bitmap(3)create_bitmap_ex(3)create_light_table(3)create_rgb_table(3)create_trans_table(3)destroy_bitmap(3)draw_trans_sprite(3)drawing_mode(3)install_keyboard(3)install_mouse(3)install_timer(3)keypressed(3)load_bitmap(3)mouse_x(3)mouse_y(3)poll_mouse(3)rectfill(3)replace_filename(3)rest(3)rgb_map(3)screen(3)set_alpha_blender(3)set_gfx_mode(3)set_palette(3)set_trans_blender(3)set_write_alpha_blender(3)stretch_blit(3)
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
- 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