I'm experimenting with using Allegro 5's API for GLSL shaders in my C++ application. I can successfully use the al_get_default_shader_source() call to retrieve the default vertex shader, write a little glsl shader with uniforms passed in to fool with the colors, link and use it and when drawing my bitmap to the backbuffer everything works out OK.
I'm struggling with getting texture samplers to work though, I've spent some time searching for what glsl shader source code I should use for the vertex and pixel shader so I can just do a basic test of using al_set_shader_sampler() to set an ALLEGRO_BITMAP as the sampler and write the data of the selected bitmap direct to the backbuffer verbatim, but I guess I haven't found the for-dummies-show-me-like-I'm-eight example that I'm looking for. I'm actually not entirely sure whether this is possible or whether to use a glsl sampler texture I have to draw a primitive and render with that...
I'm a little confused by the set of macros listed at <a href="http://liballeg.org/a5docs/trunk/shader.html</a> when I have "ALLEGRO_PROGRAMMABLE_PIPELINE" set. As I understand it these are macros that refer to internal variables used by say the default vertex shader so that I can use its vertex data in my pixel shader? What's the significance of "ALLEGRO_SHADER_VAR_USE_TEX" boolean, do I have to set that to "true" somewhere for samplers to work?
I'd also be interested to know if it's possible to render bitmaps to other video bitmaps with glsl shaders applied efficiently, or if rendering using shaders is only efficient when drawing to the backbuffer.
Thanks for any help