Recently, I have been experimenting with 2D rendering for a side project. I built the renderer based off the 3D renderer I wrote a bit back using OpenGL and C++. Most of the code was reusable, so it was not a hassle to set up basic functionality. The difficult part was figuring out how to light the scene.
For handling lighting, I took a lot of inspiration from an article on 2D visibility over at Red Blob Games. In function, my algorithm is fairly similar. I apply it to mask light sources to areas they affect. In the future, I intend on repurposing this work to affect sound propagation in the scene and in an AI system.