1al_set_shader_sampler(3) al_set_shader_sampler(3)
2
3
4
6 al_set_shader_sampler - Allegro 5 API
7
9 #include <allegro5/allegro.h>
10
11 bool al_set_shader_sampler(const char *name,
12 ALLEGRO_BITMAP *bitmap, int unit)
13
15 Sets a texture sampler uniform and texture unit of the current target
16 bitmap's shader. The given bitmap must be a video bitmap.
17
18 Different samplers should use different units. The bitmap passed to
19 Allegro's drawing functions uses the 0th unit, so if you're planning on
20 using the al_tex variable in your pixel shader as well as another sam‐
21 pler, set the other sampler to use a unit different from 0. With the
22 primitives addon, it is possible to free up the 0th unit by passing
23 NULL as the texture argument to the relevant drawing functions. In
24 this case, you may set a sampler to use the 0th unit and thus not use
25 al_tex (the al_use_tex variable will be set to false).
26
27 Returns true on success. Otherwise returns false, e.g. if the uniform
28 by that name does not exist in the shader.
29
31 5.1.0
32
34 al_use_shader(3)
35
36
37
38Allegro reference manual al_set_shader_sampler(3)