Share via


GraphicsDevice.GetRenderTarget Method

Gets a render target surface.

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

Syntax

public RenderTarget GetRenderTarget (
         int renderTargetIndex
)

Parameters

  • renderTargetIndex
    Index of the render target.

Return Value

The render target surface of the current graphics device.

Exceptions

Exception type Condition
ArgumentException An invalid render target index was requested. On Xbox 360, there is only one render target available and renderTargetIndex must be zero.

Remarks

The GraphicsDevice can support multiple render targets. The number of render targets supported by a GraphicsDevice is contained in NumberSimultaneousRenderTargets.

See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Platforms

Xbox 360, Windows XP SP2, Windows Vista