Share via


RenderToSurface.RenderToSurface(Device,Int32,Int32,Format,Boolean,DepthFormat) Constructor (Microsoft.DirectX.Direct3D)

Initializes a new instance of the RenderToSurface class.

Definition

Visual Basic Public Sub New( _
    ByVal device As Device, _
    ByVal width As Integer, _
    ByVal height As Integer, _
    ByVal format As Format, _
    ByVal depthStencil As Boolean, _
    ByVal depthStencilFormat As DepthFormat _
)
C# public RenderToSurface(
    Device device,
    int width,
    int height,
    Format format,
    bool depthStencil,
    DepthFormat depthStencilFormat
);
C++ public:
 RenderToSurface(
    Devicedevice,
    int width,
    int height,
    Format format,
    bool depthStencil,
    DepthFormat depthStencilFormat
);
JScript public function RenderToSurface(
    device : Device,
    width : int,
    height : int,
    format : Format,
    depthStencil : boolean,
    depthStencilFormat : DepthFormat
);

Parameters

device Microsoft.DirectX.Direct3D.Device
A Device to associate with the render surface.
width System.Int32
Value that represents the width of the render surface, in pixels.
height System.Int32
Value that represents the height of the render surface, in pixels.
format Microsoft.DirectX.Direct3D.Format
Member of the Format enumeration that describes the pixel format of the render surface.
depthStencil System.Boolean
Set to true if the render surface supports a depth-stencil surface; otherwise, false.
depthStencilFormat Microsoft.DirectX.Direct3D.DepthFormat
If depthStencil is set to true, this parameter is a member of the Format enumeration that describes the depth-stencil format of the render surface.

Remarks

Exceptions

InvalidCallException

The method call is invalid. For example, a method's parameter might contain an invalid value.

OutOfMemoryExceptionLeave Site

Microsoft Direct3D could not allocate sufficient memory to complete the call.