So in the game I'm porting, I have a function where I need recolor pixels in a particular area except for black. It looks something like this
Where x1,y1 is the upper left corner of the area and x2 and y2 is the lower left. Now, how I'm doing it now, is copying the area from the screen to a temp bitmap, and then using a for/next loop to check the color of every pixel and then set that pixel color if it's not black. After that is done, I copy that bitmap section back to the screen.
It's super slow, and large bitmaps are causing my game to drop to below 5 FPS. That in itself is strange because, I mean, I'm pushing 3.4Ghz here and someting a trivial as changing a pixel color is bogging down my system. I've been told that I should be using a pixel shader, and doing a quick skims about them they seem over complicated for what I'm trying to accomplish. But now it's serously impacting my game and I need to learn them once and for all.
The problem I'm having is that every time I try and research info about what a pixel shader it's either really vague or goes in some crazy OpenGL/Direct3D low level graphics card mathematics junk.
The Allegro API is not helpful. It shows me how to make a shader object, but then say I need to attach the source code to a shader to make it work. What source code? What language? How do you "program" a shader? When I look up a shader language it, it gives me like 30 of them with stuff like "fragmets" and you have to pass vectors and stuff. It seems so complex.
I guess the upshot is, can someone show me the "front door" on all of this. No 3D OpenGL/DaretX stuff, no low level graphics card gunk, I don't need "vectors" or "fragments" or "tessellation", I am just looking for a fast way to recolor an area of the screen to another color (except for black).