Field of View Rendering

I am working on a top down space game what I want for it is to make it so that when you are in a hallway you can’t see into other rooms that are blocked by doors or walls, but if they have windows you can see into them, or the door is open.

You need some kind of shadow casting thing.