3 #if SILICONSTUDIO_PARADOX_GRAPHICS_API_DIRECT3D
6 namespace SiliconStudio.
Paradox.Graphics
11 public partial class RasterizerState
19 private RasterizerState(GraphicsDevice device, RasterizerStateDescription rasterizerStateDescription) : base(device)
21 Description = rasterizerStateDescription;
23 CreateNativeDeviceChild();
27 protected internal override void OnDestroyed()
34 protected internal override bool OnRecreate()
37 CreateNativeDeviceChild();
45 internal void Apply(GraphicsDevice device)
47 device.NativeDeviceContext.Rasterizer.State = (SharpDX.Direct3D11.RasterizerState)NativeDeviceChild;
50 private void CreateNativeDeviceChild()
52 SharpDX.Direct3D11.RasterizerStateDescription nativeDescription;
56 nativeDescription.IsFrontCounterClockwise = Description.FrontFaceCounterClockwise;
57 nativeDescription.DepthBias = Description.DepthBias;
58 nativeDescription.SlopeScaledDepthBias = Description.SlopeScaleDepthBias;
59 nativeDescription.DepthBiasClamp = Description.DepthBiasClamp;
60 nativeDescription.IsDepthClipEnabled = Description.DepthClipEnable;
61 nativeDescription.IsScissorEnabled = Description.ScissorTestEnable;
62 nativeDescription.IsMultisampleEnabled = Description.MultiSampleAntiAlias;
63 nativeDescription.IsAntialiasedLineEnabled = Description.MultiSampleAntiAliasLine;
65 NativeDeviceChild =
new SharpDX.Direct3D11.RasterizerState(NativeDevice, nativeDescription);
CullMode
Indicates triangles facing a particular direction are not drawn.