/// <summary> /// <p>Create a rasterizer state object that tells the rasterizer stage how to behave.</p> /// </summary> /// <param name="device">The <see cref="GraphicsDevice"/>.</param> /// <param name="rasterizerState">An existing <see cref="Direct3D11.RasterizerState"/> instance.</param> /// <remarks> /// <p>4096 unique rasterizer state objects can be created on a device at a time.</p><p>If an application attempts to create a rasterizer-state interface with the same state as an existing interface, the same interface will be returned and the total number of unique rasterizer state objects will stay the same.</p> /// </remarks> /// <msdn-id>ff476516</msdn-id> /// <unmanaged>HRESULT ID3D11Device::CreateRasterizerState([In] const D3D11_RASTERIZER_DESC* pRasterizerDesc,[Out, Fast] ID3D11RasterizerState** ppRasterizerState)</unmanaged> /// <unmanaged-short>ID3D11Device::CreateRasterizerState</unmanaged-short> public static RasterizerState New(GraphicsDevice device, Direct3D11.RasterizerState rasterizerState) { return(new RasterizerState(device, rasterizerState)); }
/// <summary> /// Initializes a new instance of the <see cref="RasterizerState" /> class. /// </summary> /// <param name="device">The <see cref="GraphicsDevice"/>.</param> /// <param name="nativeState">State of the native.</param> private RasterizerState(GraphicsDevice device, Direct3D11.RasterizerState nativeState) : base(device.MainDevice) { Description = nativeState.Description; Initialize(nativeState); }