GraphicsDevice.GetRenderTarget Method

Gets a render target surface.

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

public RenderTarget GetRenderTarget (
         int renderTargetIndex


Index of the render target.

Return Value

The render target surface of the current graphics device.

Exception typeCondition
ArgumentOutOfRangeExceptionAn invalid render target index was requested. On Xbox 360, there is only one render target available and renderTargetIndex must be zero.

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

Xbox 360, Windows XP SP2, Windows Vista, Zune

Community Additions