ALLEGRO_SHADER_TYPE(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ NAME ✨

ALLEGRO_SHADER_TYPE β€” bestie, it's the Allegro 5 API πŸ’–


🌸 SYNOPSIS 🌸

#include <allegro5/allegro.h>

typedef enum ALLEGRO_SHADER_TYPE ALLEGRO_SHADER_TYPE;

πŸŽ€ DESCRIPTION πŸŽ€

okay so listen πŸ‘‘ this lil enum is what you pass to al_attach_shader_source(3alleg5) and al_attach_shader_source_file(3alleg5) so those functions know how to interpret the source you're attaching. it's giving "what kind of shader is this" energy, no cap πŸ’…

πŸ’œ ALLEGRO_VERTEX_SHADER

a vertex shader, babes β€” it runs once for each vertex it's used with. the program spits out exactly one vertex at a time. periodt. ✨

and when Allegro's graphics are the ones doing the drawing? then on top of all the vertices of primitives from the primitives addon, every single drawn bitmap also counts as four vertices. yup, four. iconic behavior fr fr πŸ¦‹

🌈 ALLEGRO_PIXEL_SHADER

a pixel shader, queen β€” it runs for each pixel it's used with, and the program outputs exactly one pixel at a time, either into the backbuffer or into the current target bitmap. πŸ’…

with Allegro's builtin graphics, that means the shader gets called for, like, each destination pixel of the output of an al_draw_bitmap(3alleg5) call. so if you're drawing a bitmap, every pixel that lands gets a visit. 🫢

ok tiny lore drop: a more accurate term for "pixel shader" would lowkey be fragment shader, because one final pixel in the target bitmap isn't necessarily composed of just a single output β€” it can be made of multiple fragments. like when multi-sampling is being used, bestie. so yeah, "fragment" is the more precise vibe. 🌸

⭐ SINCE ⭐

5.1.0 β€” she's been here since 5.1.0, we stan a legacy icon πŸ’–


and that's the whole page, bestie!! go forth and shade those vertices and pixels, you absolute main character πŸ§šπŸ’œ

mwah πŸ’‹ β€” this was the Allegro reference manual, page ALLEGRO_SHADER_TYPE(3alleg5), dated 2024-01-01 (the source version that shipped with the whole 3alleg5 set). catch you in the next manpage!! πŸŽ€βœ¨

πŸ“¦ where this page comes from