GraphicsDevice Members

The following tables list the members exposed by the GraphicsDevice type.

Public Constructors

Name Description
Public Method GraphicsDevice Creates an instance of this object.

Public Properties

Name Description
Public Property Adapter Gets the graphics adapter.
Public Property BlendFactor Gets or sets the color used for a constant-blend factor during alpha blending. The default value is Color.White.
Public Property BlendState Gets or sets a system-defined instance of a blend state object initialized for alpha blending. The default value is BlendState.Opaque.
Public Property DepthStencilState Gets or sets a system-defined instance of a depth-stencil state object. The default value is DepthStencilState.Default.
Public Property DisplayMode Retrieves the display mode's spatial resolution, color resolution, and refresh frequency.
Public Property GraphicsDeviceStatus Retrieves the status of the device.
Public Property GraphicsProfile Gets the graphics profile. The default value is GraphicsProfile.Reach.
Public Property Indices Gets or sets index data. The default value is null.
Public Property IsDisposed Gets a value that indicates whether the object is disposed.
Public Property MultiSampleMask Gets or sets a bitmask controlling modification of the samples in a multisample render target. The default value is -1 (0xffffffff).
Public Property PresentationParameters Gets the presentation parameters associated with this graphics device.
Public Property RasterizerState Gets or sets rasterizer state. The default value is RasterizerState.CullCounterClockwise.
Public Property ReferenceStencil Gets or sets a reference value for stencil testing. The default value is zero.
Public Property SamplerStates Retrieves a collection of SamplerState objects for the current GraphicsDevice.
Public Property ScissorRectangle Gets or sets the rectangle used for scissor testing. By default, the size matches the render target size.
Public Property Textures Returns the collection of textures that have been assigned to the texture stages of the device.
Public Property VertexSamplerStates Gets the collection of vertex sampler states.
Public Property VertexTextures Gets the collection of vertex textures that support texture lookup in the vertex shader using the texldl statement. The vertex engine contains four texture sampler stages.
Public Property Viewport Gets or sets a viewport identifying the portion of the render target to receive draw calls.

Public Methods

Name Description
Public Method Clear Overloaded. Clears resource buffers.
Public Method Dispose Overloaded. Immediately releases the unmanaged resources used by this object.
Public Method DrawIndexedPrimitives Renders the specified geometric primitive, based on indexing into an array of vertices.
Public Method DrawInstancedPrimitives Draws a series of instanced models.
Public Method DrawPrimitives Renders a sequence of non-indexed geometric primitives of the specified type from the current set of data input streams.
Public Method DrawUserIndexedPrimitives Overloaded. Renders geometric primitives.
Public Method DrawUserPrimitives Overloaded. Renders geometric primitives.
Public Method Equals (Inherited from Object.)
Public Method GetBackBufferData Overloaded. Gets the contents of the back buffer.
Public Method GetHashCode (Inherited from Object.)
Public Method GetRenderTargets Gets a render target surface.
Public Method GetType (Inherited from Object.)
Public Method GetVertexBuffers Gets the vertex buffers.
Public Method Present Overloaded. Presents the display with the contents of the next buffer in the sequence of back buffers owned by the GraphicsDevice.
Public Method Reset Overloaded. Resets the presentation parameters for the current GraphicsDevice.
Public Method SetRenderTarget Overloaded. Sets a new color buffer for a GraphicsDevice.
Public Method SetRenderTargets Sets an array of render targets.
Public Method SetVertexBuffer Overloaded. Sets or binds a vertex buffer to a device.
Public Method SetVertexBuffers Sets the vertex buffers.
Public Method ToString (Inherited from Object.)

Protected Methods

Name Description
Protected Method Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the object.
Protected Method MemberwiseClone (Inherited from Object.)

Public Events

Name Description
Public Event DeviceLost Occurs when a GraphicsDevice is about to be lost (for example, immediately before a reset).
Public Event DeviceReset Occurs after a GraphicsDevice is reset, allowing an application to recreate all resources.
Public Event DeviceResetting Occurs when a GraphicsDevice is resetting, allowing the application to cancel the default handling of the reset.
Public Event Disposing Occurs when Dispose is called or when this object is finalized and collected by the garbage collector of the Microsoft .NET common language runtime.
Public Event ResourceCreated Occurs when a resource is created.
Public Event ResourceDestroyed Occurs when a resource is destroyed.

Extension Methods

  Name Description
  SetSharingMode Enable/disable sharing a graphics device between Silverlight and XNA.

See Also

Reference

GraphicsDevice Class
Microsoft.Xna.Framework.Graphics Namespace