I'm a beginner trying to implement a flashlight in SDL2, but can't figure out a good way to do it.
I've found a way to manipulate the background's color; changed it to dark and back to its normal colors, but this isn't the whole solution.
My main goal is a flashlight that follows the player around the map.
I thought about per-pixel drawing, but I think it will result in poor performance. Drawing a black pixel for every pixel on screen, then changing back the to the normal color to all of the pixels surrounding the player.
How do I do this correctly?(BTW, I'm using a 'SDL_Renderer', not 'SDL_Surface', i realized this can be a problem when dealing with pixels.)