al_set_shader_sampler(3)

πŸ“¦
version 5.2.11.3 Β· 3 versions
, in arch rolling

πŸŽ€ NAME πŸŽ€

Welcome to the Library Functions Manual, bestie β€” this is al_set_shader_sampler(3) from the Allegro 5 API πŸ’…

al_set_shader_sampler β€” the Allegro 5 API function for setting a shader sampler, no cap.

✨ SYNOPSIS ✨

#include <allegro5/allegro.h>

bool al_set_shader_sampler(const char *name,
   ALLEGRO_BITMAP *bitmap, int unit)

πŸ’– DESCRIPTION πŸ’–

Okay so here’s the tea: this sets a texture sampler uniform and texture unit of the current target bitmap’s shader. The given bitmap must be a video bitmap β€” that part is not optional, bestie 🫢

Different samplers should use different units. The bitmap passed to Allegro’s drawing functions uses the 0th unit, so if you’re planning on using the al_tex variable in your pixel shader as well as another sampler, set the other sampler to use a unit different from 0 ✨

With the primitives addon, it is possible to free up the 0th unit by passing NULL as the texture argument to the relevant drawing functions. In this case, you may set a sampler to use the 0th unit and thus not use al_tex (the al_use_tex variable will be set to false) πŸ‘‘

Returns true on success. Otherwise returns false, e.g. if the uniform by that name does not exist in the shader. That’s the whole return situation, periodt 😭

⭐ SINCE ⭐

5.1.0 β€” yes bestie, this one has been around since 5.1.0 πŸ’œ

🌈 SEE ALSO 🌈


πŸ’– Cute sign-off from the Allegro reference manual β€” that’s the source/version line energy, and the footer didn’t include a date, so we’re not inventing one. al_set_shader_sampler(3), out πŸŽ€

πŸ“¦ where this page comes from
  • arch rolling: allegro 5.2.11.3-2 Β· Zlib AND BSD-3-Clause AND OFL-1.1 AND LicenseRef-Custom
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms