public static DotGame.Graphics.Comparison Convert(SharpDX.Direct3D11.Comparison comparsionFunction) { if (!comparsionFunctions.ContainsValue(comparsionFunction)) { throw new NotImplementedException(); } return(comparsionFunctions.First((f) => f.Value == comparsionFunction).Key); }
public static D3D.DepthStencilState CreateDepthStencilState(this D3D.Device device, D3D.Comparison comparison, D3D.StencilOperation failOperation, D3D.StencilOperation passOperation) { var operationDesc = new D3D.DepthStencilOperationDescription() { Comparison = comparison, DepthFailOperation = D3D.StencilOperation.Keep, FailOperation = failOperation, PassOperation = passOperation, }; var depthStencilDesc = new D3D.DepthStencilStateDescription() { IsDepthEnabled = false, IsStencilEnabled = true, StencilReadMask = byte.MaxValue, StencilWriteMask = byte.MaxValue, FrontFace = operationDesc, BackFace = operationDesc, }; return(new D3D.DepthStencilState(device, depthStencilDesc)); }