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
graphicsDevice
GraphicsDevicewidth
intheight
int
RenderTarget2D(GraphicsDevice, int, int, bool, SurfaceFormat, DepthFormat)
public RenderTarget2D(GraphicsDevice graphicsDevice, int width, int height, bool mipMap, SurfaceFormat preferredFormat, DepthFormat preferredDepthFormat)
Parameters
graphicsDevice
GraphicsDevicewidth
intheight
intmipMap
boolpreferredFormat
SurfaceFormatpreferredDepthFormat
DepthFormat
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
graphicsDevice
GraphicsDevicewidth
intheight
intmipMap
boolpreferredFormat
SurfaceFormatpreferredDepthFormat
DepthFormatpreferredMultiSampleCount
intusage
RenderTargetUsage
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
graphicsDevice
GraphicsDevicewidth
intheight
intmipMap
boolformat
SurfaceFormatdepthFormat
DepthFormatpreferredMultiSampleCount
intusage
RenderTargetUsagesurfaceType
Texture2D.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
graphicsDevice
GraphicsDevicewidth
intheight
intmipMap
boolpreferredFormat
SurfaceFormatpreferredDepthFormat
DepthFormatpreferredMultiSampleCount
intusage
RenderTargetUsageshared
bool
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
graphicsDevice
GraphicsDevicewidth
intheight
intmipMap
boolpreferredFormat
SurfaceFormatpreferredDepthFormat
DepthFormatpreferredMultiSampleCount
intusage
RenderTargetUsageshared
boolarraySize
int
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
disposing
boolTrue 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
graphicsDevice
GraphicsDevicepreferredFormat
SurfaceFormat
Returns
Events
ContentLost
public event EventHandler<EventArgs> ContentLost