al_set_shader_int(3alleg5)

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

πŸ’– 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