fixes for switching between 2d and 3d graphics rendering