I want to change one of the deafult values of my GraphicsDevice to that:
GraphicsDevice.DepthStencilState.DepthBufferEnable = true;
But, I only know how to change it at runtime in the Draw method by putting this code (which means changing the value every time the draw method is called!):
DepthStencilState state = new DepthStencilState();
state.DepthBufferEnable = true;
GraphicsDevice.DepthStencilState = state;
Does someone know how to change it once in an efficient way?
You can use this code anywhere the GraphicsDevice is available. I would put it in LoadContent() or Initalize().