Exemplo n.º 1
0
 public static DotGame.Graphics.CullMode Convert(SharpDX.Direct3D11.CullMode cullMode)
 {
     if (!cullModes.ContainsValue(cullMode))
     {
         throw new NotImplementedException();
     }
     return(cullModes.First((f) => f.Value == cullMode).Key);
 }
Exemplo n.º 2
0
        /// <summary>
        /// Sets the cull mode.
        /// </summary>
        /// <param name="cullMode">The cull mode.</param>
        /// <exception cref="System.Exception"></exception>
        public void SetCullMode(D3D11.CullMode cullMode)
        {
            if (d3dContext == null)
            {
                throw new Exception(MethodBase.GetCurrentMethod().Name + "DeviceContext is null");
            }

            D3D11.RasterizerStateDescription rasterDesc = d3dContext.Rasterizer.State.Description;
            rasterDesc.CullMode = cullMode;

            SetRasterizerState(rasterDesc);
        }