Sorry, the Forum is closed :(

Unfortunately, the forum is now closed.

Please read the following post for further details.

We apologize for the inconvenience.
The SharpDX team.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Toggling DepthEnable flag

Toggling DepthEnable flag 1 year 8 months ago #1213

Can someone explain how I can change the DepthEnable flag at runtime? I'm trying to switch between 3d rendering and 2d rendering without using Direct2D1. As far as I can tell I need to get access to the DepthStencilStateDescription but I don't know how to get to it from the variables I do have access to.
I'm working in Windows 8 metro c# and I've imported the CommonDX project from the samples so I have a d3dDevice and d3dContext as well as a SwapChainBackgroundPanelTarget as my render destination.
Anyone know where to go with this?
Thanks
The administrator has disabled public write access.

Re: Toggling DepthEnable flag 1 year 8 months ago #1217

Found it.
DepthStencilStateDescription description = DepthStencilStateDescription.Default();
description.IsDepthEnabled = false;
description.IsStencilEnabled = false;
description.DepthWriteMask = DepthWriteMask.Zero;
depthState2D = new SharpDX.Direct3D11.DepthStencilState( App.deviceManager.DeviceDirect3D, description );
ContextDirect3D.OutputMerger.SetDepthStencilState( depthState2D );
The administrator has disabled public write access.
  • Page:
  • 1
Time to create page: 0.157 seconds