1, 2 and 3 are the images showing the outputs with B (not darwing the bitmap), with B but not N (drawing it without the shader), and B and N (drawing it with shader). The shader is a simple shader that sets every pixel to (1, 0, 0). So why this strange behaviour? What's more, if I try drawing another bitmap without changing the shader, it is still drawn in it's normal form - no shaders used. I seriously have no idea what the hell is going on now

Nope, I am not. For heaven's sake, one part of the bitmap (i'm sure it's all one bitmap, since not drawing it draws a blank screen) is being drawn red, and the other half is being drawn with the proper colors! That has to proof enough that I'm not messing up with the calls!

P.S. sorry if I sound exasperated, I've been staring at this code for so long trying to figure out why the shader is not working properly.

Nope, I am not. For heaven's sake, one part of the bitmap (i'm sure it's all one bitmap, since not drawing it draws a blank screen) is being drawn red, and the other half is being drawn with the proper colors! That has to proof enough that I'm not messing up with the calls!

I don't know about that. You are calling al_set_target_bitmap if you changed it at all before the code you showed us, that could easily be causing some issues.

The code before this just draws things to screenBitmap, and this is the final thing that draws the screenBitmap to my display. After this, I draw FPS, and flip the display (no more functions calls whatsoever to allegro, except one al_draw_text to draw the FPS).

"The current shader (set by al_use_shader) is local to the target bitmap."Just curious, does that mean that if I use bitmap A, use shader A_Shader, change my bitmap to B, use a different shader B_Shader and finally switch back to A again, that will still have A_Shader active? I guess I somehow overlooked this technicality. If so, then that might be the cause of my problem. I'll just go ahead and try playing with my code again, with this assumption.

Yeah, that did it, and now I'm feeling like a dumb ass for not realizing that earlier

Btw, if I'm not wrong, the last time I used vanilla openGl, the shader was constant till the time you changed it - and not dependent on the target (been a long time since I used it, so please correct me if I'm wrong). So why does Allegro bind it's shaders to target bitmaps, as opposed to having them bound till they are replaced, irrespective of the target bitmaps?