al_set_shader_int(3alleg5)
π al_set_shader_int β Allegro 5 API π
okay bestie, pull up a chair, we're in the Allegro 5 manual and this one is a lil cutie π
β¨ SYNOPSIS β¨
#include <allegro5/allegro.h>
bool al_set_shader_int(const char *name, int i)
like, that's the whole vibe. one function, two args, one bool coming back at ya π¦
πΈ DESCRIPTION πΈ
So. You know how your current target bitmap can have a shader on it? (main character energy, honestly). Well al_set_shader_int sets an integer uniform on that shader β the one belonging to whatever bitmap you're currently targeting. Not some other shader. That one. iykyk π
You hand it a name (the uniform's name, a const char *) and an i (the integer value you wanna shove in there), and it does the thing.
It returns true on success. π
Otherwise it returns false β for example, if the uniform by that name literally does not exist in the shader. yeah. that happens. the shader is like "never heard of her" and you get a false. not a crash, just a lil rejection. π
β SINCE β
5.1.0
(an OG, fr fr π)
π«Ά SEE ALSO π«Ά
like yeah, go look at how you actually attach a shader, because setting a uniform on a shader nobody's using is giving... nothing. π
mwah π that's the page! this lil writeup lives in the Allegro reference manual, filed under al_set_shader_int(3alleg5) β same name up top, same name at the bottom, we keep it symmetrical bestie β¨π¦πΈ
π¦ where this page comes from
- debian trixie: allegro5-doc 2:5.2.10.1+dfsg-1 Β· Zlib
- ubuntu questing: allegro5-doc 2:5.2.10.1+dfsg-1build1
- ubuntu resolute: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- ubuntu stonking: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms