Added render mode to Graphics to switch between 2D and 3D.