예제 #1
0
        protected override void InitializeInternal()
        {
            var desc = RasterizerStateDescription.Default();

            desc.IsFrontCounterClockwise = Settings.WindingOrder == WindingOrder.Counterclockwise;
            desc.FillMode                 = Settings.RenderWireframe ? FillMode.Wireframe : FillMode.Solid;
            desc.IsDepthClipEnabled       = Settings.EnableDepthTest;
            desc.IsMultisampleEnabled     = Settings.Antialiasing == Antialiasing.Multisample;
            desc.IsAntialiasedLineEnabled = Settings.Antialiasing == Antialiasing.LinesOnly;
            switch (Settings.TriangleCulling)
            {
            case TriangleCulling.DrawFrontFacing:
                desc.CullMode = CullMode.Back;
                break;

            case TriangleCulling.DrawBackFacing:
                desc.CullMode = CullMode.Front;
                break;

            case TriangleCulling.DrawAll:
                desc.CullMode = CullMode.None;
                break;
            }
            State = new global::SharpDX.Direct3D11.RasterizerState(DeviceManager.Device, desc);
        }
예제 #2
0
 protected override void UninitializeInternal()
 {
     if(State != null)
     {
         State.Dispose();
         State = null;
     }
 }
예제 #3
0
 protected override void InitializeInternal()
 {
     var desc = RasterizerStateDescription.Default();
     desc.IsFrontCounterClockwise = Settings.WindingOrder == WindingOrder.Counterclockwise;
     desc.FillMode = Settings.RenderWireframe ? FillMode.Wireframe : FillMode.Solid;
     desc.IsDepthClipEnabled = Settings.EnableDepthTest;
     desc.IsMultisampleEnabled = Settings.Antialiasing == Antialiasing.Multisample;
     desc.IsAntialiasedLineEnabled = Settings.Antialiasing == Antialiasing.LinesOnly;
     switch(Settings.TriangleCulling)
     {
         case TriangleCulling.DrawFrontFacing:
             desc.CullMode = CullMode.Back;
             break;
         case TriangleCulling.DrawBackFacing:
             desc.CullMode = CullMode.Front;
             break;
         case TriangleCulling.DrawAll:
             desc.CullMode = CullMode.None;
             break;
     }
     State = new global::SharpDX.Direct3D11.RasterizerState(_deviceManager.Device, desc);
 }