I'm currently learning opengl but it seems quite complicated so i considered using some library like sdl or allegro. I noticed that allegro has some built in functions to create and attach shaders.

But my question is: do my shaders "shade" everything i render with allegro or they are only functions to ease the work of loading shaders with opengl/directx?

Any help apreciated!


1 Answer 1


They work in a similar, if not identical, way as in openGL/DirectX shaders... The only difference is that an ALLEGRO_SHADER needs to contain both a fragment and vertex shader for rendering to work.

The way they work is that you attach a shader program to the device or display and then all drawings done in it will pass through the shader, so to achieve different effects you can detach the previous shader and then attach the new one on run-time as necessary.

  • \$\begingroup\$ cool, I might give it a try, right now I'm using libgdx and I'm quite happy with it. This is a nice feature to have, though. \$\endgroup\$
    – twkmz
    Sep 18, 2015 at 13:18
  • 1
    \$\begingroup\$ @ochi12 in case you get stuck when you try it, the source code of allegro has some examples showing the usage of shaders, as the docs only define the functions available but shown no example. \$\endgroup\$
    – rlam12
    Sep 18, 2015 at 13:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .