I have coded a game in OpenGL and for rendering I used a Sprite Batching technique to draw many sprites in a single call to glDrawElements(). But as soon as I wanted to use a different shader for a different state of the character, I noticed that I couldn't do it.
As I understood, all the necessary data is entered into the shader at the moment of renderer initialization and when I call Flush function, the renderer doesn't care which shader I use for drawing, all the data is already entered into the main one.
Will I have to give up with Sprite Batching, or is there a way to use several shaders at once?