【发布时间】:2019-01-11 13:48:44
【问题描述】:
我想将我的 GraphicsDevice 的默认值之一更改为:
GraphicsDevice.DepthStencilState.DepthBufferEnable = true;
但是,我只知道如何在运行时在 Draw 方法中通过放置这段代码来更改它(这意味着每次调用 draw 方法时都会更改值!):
DepthStencilState state = new DepthStencilState();
state.DepthBufferEnable = true;
GraphicsDevice.DepthStencilState = state;
有人知道如何以有效的方式更改一次吗?
【问题讨论】: