GraphicsDevice Class

Performs primitive-based rendering, creates resources, handles system-level variables, and creates shaders.

System.Object
  Microsoft.Xna.Framework.Graphics.GraphicsDevice

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

public abstract class GraphicsDevice

The GraphicsDevice type exposes the following members.

  NameDescription
Public propertyAdapterGets the graphics adapter.
Public propertyBlendFactorGets or sets the color used for a constant-blend factor during alpha blending. The default value is White.
Public propertyBlendStateGets or sets a system-defined instance of a blend state object initialized for alpha blending. The default value is Opaque.
Public propertyDepthStencilStateGets or sets a system-defined instance of a depth-stencil state object. The default value is Default.
Public propertyIndicesGets or sets index data. The default value is null.
Public propertyMultiSampleMaskGets or sets a bitmask controlling modification of the samples in a multisample render target. The default value is -1 (0xffffffff).
Public propertyPresentationParametersGets the presentation parameters associated with this graphics device.
Public propertyRasterizerStateGets or sets rasterizer state. The default value is CullCounterClockwise.
Public propertyReferenceStencilGets or sets a reference value for stencil testing. The default value is zero.
Public propertySamplerStatesGets a collection of SamplerState objects for the current GraphicsDevice.
Public propertyScissorRectangleGets or sets the rectangle used for scissor testing. By default, the size matches the render target size.
Public propertyTexturesGets the collection of textures that have been assigned to the texture stages of the device.
Public propertyViewportGets or sets a viewport identifying the portion of the render target to receive draw calls.
Top

  NameDescription
Public methodClear(Color)Clears resource buffers.
Public methodClear(ClearOptions, Color, Single, Int32)Clears resource buffers.
Public methodDrawIndexedPrimitivesRenders the specified geometric primitive, based on indexing into an array of vertices.
Public methodDrawPrimitivesRenders a sequence of non-indexed geometric primitives of the specified type from the current set of data input streams.
Public methodGetRenderTargetsGets a render target surface.
Public methodGetVertexBuffersGets the vertex buffers.
Public methodSetRenderTarget(RenderTarget2D)Sets a new render target for this GraphicsDevice.
Public methodSetRenderTarget(RenderTargetCube, CubeMapFace)Sets a new render target for this GraphicsDevice.
Public methodSetRenderTargetsSets an array of render targets.
Public methodSetVertexBuffer(VertexBuffer)Sets or binds a vertex buffer to the device.
Public methodSetVertexBuffer(VertexBuffer, Int32)Sets or binds a vertex buffer to the device.
Public methodSetVertexBuffersSets the vertex buffers.
Top

  NameDescription
Public Extension MethodGetPixelShaderGets the PixelShader that is associated with the specified GraphicsDevice. (Defined by GraphicsDeviceExtensions.)
Public Extension MethodGetVertexShaderGets the VertexShader associated with the specified GraphicsDevice. (Defined by GraphicsDeviceExtensions.)
Public Extension MethodSetPixelShaderAssociates the specified PixelShader with the specified GraphicsDevice. (Defined by GraphicsDeviceExtensions.)
Public Extension MethodSetPixelShaderConstantFloat4<T>(Int32, T)Overloaded. Sets a constant register to a generic data type which is passed to the pixel shader on the graphics device. (Defined by GraphicsDeviceExtensions.)
Public Extension MethodSetPixelShaderConstantFloat4<T>(Int32, Int32, T)Overloaded. Sets a constant register to a generic data type which is passed to the pixel shader on the graphics device. (Defined by GraphicsDeviceExtensions.)
Public Extension MethodSetVertexShaderAssociates the specified VertexShader with the specified GraphicsDevice. (Defined by GraphicsDeviceExtensions.)
Public Extension MethodSetVertexShaderConstantFloat4<T>(Int32, T)Overloaded. Sets a constant register to a generic data type which is passed to the vertex shader on the graphics device. (Defined by GraphicsDeviceExtensions.)
Public Extension MethodSetVertexShaderConstantFloat4<T>(Int32, Int32, T)Overloaded. Sets a constant register to a generic data type which is passed to the vertex shader on the graphics device. (Defined by GraphicsDeviceExtensions.)
Top

Silverlight

Supported in: 5

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

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

Community Additions

ADD
Show: