Class RenderTarget2D
public class RenderTarget2D : Texture2D, IDisposable
- Inheritance
-
RenderTarget2D
- Implements
- Inherited Members
Constructors
RenderTarget2D(GraphicsDevice, int, int)
public RenderTarget2D(GraphicsDevice graphicsDevice, int width, int height)
Parameters
graphicsDeviceGraphicsDevicewidthintheightint
RenderTarget2D(GraphicsDevice, int, int, bool, SurfaceFormat, DepthFormat)
public RenderTarget2D(GraphicsDevice graphicsDevice, int width, int height, bool mipMap, SurfaceFormat preferredFormat, DepthFormat preferredDepthFormat)
Parameters
graphicsDeviceGraphicsDevicewidthintheightintmipMapboolpreferredFormatSurfaceFormatpreferredDepthFormatDepthFormat
RenderTarget2D(GraphicsDevice, int, int, bool, SurfaceFormat, DepthFormat, int, RenderTargetUsage)
public RenderTarget2D(GraphicsDevice graphicsDevice, int width, int height, bool mipMap, SurfaceFormat preferredFormat, DepthFormat preferredDepthFormat, int preferredMultiSampleCount, RenderTargetUsage usage)
Parameters
graphicsDeviceGraphicsDevicewidthintheightintmipMapboolpreferredFormatSurfaceFormatpreferredDepthFormatDepthFormatpreferredMultiSampleCountintusageRenderTargetUsage
RenderTarget2D(GraphicsDevice, int, int, bool, SurfaceFormat, DepthFormat, int, RenderTargetUsage, SurfaceType)
Allows child class to specify the surface type, eg: a swap chain.
protected RenderTarget2D(GraphicsDevice graphicsDevice, int width, int height, bool mipMap, SurfaceFormat format, DepthFormat depthFormat, int preferredMultiSampleCount, RenderTargetUsage usage, Texture2D.SurfaceType surfaceType)
Parameters
graphicsDeviceGraphicsDevicewidthintheightintmipMapboolformatSurfaceFormatdepthFormatDepthFormatpreferredMultiSampleCountintusageRenderTargetUsagesurfaceTypeTexture2D.SurfaceType
RenderTarget2D(GraphicsDevice, int, int, bool, SurfaceFormat, DepthFormat, int, RenderTargetUsage, bool)
public RenderTarget2D(GraphicsDevice graphicsDevice, int width, int height, bool mipMap, SurfaceFormat preferredFormat, DepthFormat preferredDepthFormat, int preferredMultiSampleCount, RenderTargetUsage usage, bool shared)
Parameters
graphicsDeviceGraphicsDevicewidthintheightintmipMapboolpreferredFormatSurfaceFormatpreferredDepthFormatDepthFormatpreferredMultiSampleCountintusageRenderTargetUsagesharedbool
RenderTarget2D(GraphicsDevice, int, int, bool, SurfaceFormat, DepthFormat, int, RenderTargetUsage, bool, int)
public RenderTarget2D(GraphicsDevice graphicsDevice, int width, int height, bool mipMap, SurfaceFormat preferredFormat, DepthFormat preferredDepthFormat, int preferredMultiSampleCount, RenderTargetUsage usage, bool shared, int arraySize)
Parameters
graphicsDeviceGraphicsDevicewidthintheightintmipMapboolpreferredFormatSurfaceFormatpreferredDepthFormatDepthFormatpreferredMultiSampleCountintusageRenderTargetUsagesharedboolarraySizeint
Properties
DepthStencilFormat
public DepthFormat DepthStencilFormat { get; }
Property Value
IsContentLost
public bool IsContentLost { get; }
Property Value
MultiSampleCount
public int MultiSampleCount { get; }
Property Value
RenderTargetUsage
Gets the usage mode of the render target.
public RenderTargetUsage RenderTargetUsage { get; }
Property Value
- RenderTargetUsage
The usage mode of the render target.
Methods
Dispose(bool)
The method that derived classes should override to implement disposing of managed and native resources.
protected override void Dispose(bool disposing)
Parameters
disposingboolTrue if managed objects should be disposed.
Remarks
Native resources should always be released regardless of the value of the disposing parameter.
GraphicsDeviceResetting()
Called before the device is reset. Allows graphics resources to invalidate their state so they can be recreated after the device reset. Warning: This may be called after a call to Dispose() up until the resource is garbage collected.
protected override void GraphicsDeviceResetting()
QuerySelectedFormat(GraphicsDevice, SurfaceFormat)
protected static SurfaceFormat QuerySelectedFormat(GraphicsDevice graphicsDevice, SurfaceFormat preferredFormat)
Parameters
graphicsDeviceGraphicsDevicepreferredFormatSurfaceFormat
Returns
Events
ContentLost
public event EventHandler<EventArgs> ContentLost