In an FPS I am developing, I am procedurally altering the appearance of textures based on game play events, and would like to know if the way I have implemented this was a good idea.
Right now, on each frame, I am grabbing a pointer to the uncompressed image and writing to it using memset. It's pretty straightforward if I want to have game play events affect the texture's appearance, because all I have to do is tie whatever attribute I like from any game object into the function writing the image data. For example, using this I could get the player's x,y position and draw an x directly to a map texture as the player moves around.
Is there a better way to implement this functionality in general?
My first thought would be to use shaders instead, but I haven't been able to find anyone doing anything like this and I know almost nothing about shaders. I feel like I could be missing something obvious to someone.
I am trying to keep this question as engine-independent as possible, but if relevant, I am using Source Engine procedural materials.