RasterizerState Class

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Contains rasterizer state, which determines how to convert vector data (shapes) into raster data (pixels).

Inheritance Hierarchy

System.Object
  Microsoft.Xna.Framework.Graphics.GraphicsResource
    Microsoft.Xna.Framework.Graphics.RasterizerState

Namespace:  Microsoft.Xna.Framework.Graphics
Assembly:  Microsoft.Xna.Framework.Graphics (in Microsoft.Xna.Framework.Graphics.dll)

Syntax

'Declaration
Public Class RasterizerState _
    Inherits GraphicsResource
public class RasterizerState : GraphicsResource

The RasterizerState type exposes the following members.

Constructors

  Name Description
Public method RasterizerState Initializes a new instance of the RasterizerState class.

Top

Properties

  Name Description
Public property CullMode Gets or sets the conditions for culling or removing triangles.
Public property DepthBias Gets or sets the depth bias for polygons, which is the amount of bias to apply to the depth of a primitive to alleviate depth testing problems for primitives of similar depth. The default value is 0.
Public property FillMode Get or sets the fill mode, which defines how a triangle is filled during rendering. The default is Solid.
Public property IsDisposed Gets a value that indicates whether the object is disposed. (Inherited from GraphicsResource.)
Public property MultiSampleAntiAlias Gets or sets a value that indicates whether multisample antialiasing is enabled. The default is true.
Public property ScissorTestEnable Get or sets a value that indicates whether scissor testing is enabled. The default is false.
Public property SlopeScaleDepthBias Gets or sets a bias value that takes into account the slope of a polygon. This bias value is applied to coplanar primitives to reduce aliasing and other rendering artifacts caused by z-fighting. The default is 0.

Top

Methods

  Name Description
Public method Dispose() Immediately releases the unmanaged resources used by this object. (Inherited from GraphicsResource.)
Protected method Dispose(Boolean) Immediately releases the unmanaged resources used by this object. (Inherited from GraphicsResource.)
Protected method Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the object. (Inherited from GraphicsResource.)

Top

Fields

  Name Description
Public fieldStatic member CullClockwise A built-in state object with settings for culling primitives with clockwise winding order.
Public fieldStatic member CullCounterClockwise A built-in state object with settings for culling primitives with counter-clockwise winding order.
Public fieldStatic member CullNone A built-in state object with settings for not culling any primitives.

Top

Version Information

Silverlight

Supported in: 5

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.