The way it’s usually done is a second camera gets inserted where the mirror is and does its own rendering pass. The result is then applied as a texture on the front. So what you see is what that camera sees.
However there have been very creative solutions in the past. For example Duke3D actually had the whole room mirrored behind the mirror and the mirror was just a piece of transparent geometry the player couldn’t pass through. The engine would spawn in an extra sprite that the player controls, but with the controls reversed. That way you could actually see “yourself” in the mirror.
The way it’s usually done is a second camera gets inserted where the mirror is and does its own rendering pass. The result is then applied as a texture on the front. So what you see is what that camera sees.
However there have been very creative solutions in the past. For example Duke3D actually had the whole room mirrored behind the mirror and the mirror was just a piece of transparent geometry the player couldn’t pass through. The engine would spawn in an extra sprite that the player controls, but with the controls reversed. That way you could actually see “yourself” in the mirror.