IDirect3DDevice2::Begin

The IDirect3DDevice2::Begin method indicates the start of a sequence of rendered primitives. This method defines the type of these primitives and the type of vertices on which they are based. The only method you can legally call between calls to IDirect3DDevice2::Begin and IDirect3DDevice2::End is IDirect3DDevice2::Vertex.

HRESULT Begin(

D3DPRIMITIVETYPE d3dpt,

D3DVERTEXTYPE d3dvt,

DWORD dwFlags

);

Parameters

d3dpt

One of the members of the D3DPRIMITIVETYPE enumerated type.

d3dvt

Indicates the type of vertices to be used in rendering this primitive. Only vertices of this type will be accepted before the corresponding IDirect3DDevice2::End.

This must be one of the members of the D3DVERTEXTYPE enumerated type, as specified in a call to the IDirect3DDevice2::Vertex method.

dwFlags

One or more of the following flags defining how the primitive is drawn:

D3DDP_DONOTCLIP The application has already done the required clipping, so the system should not necessarily clip the primitives. (This flag is a hint; the system may clip the primitive even when this flag is specified, under some circumstances.)
D3DDP_DONOTUPDATEEXTENTS Disables the updating of the screen rectangle affected by this rendering call. Using this flag can potentially help performance, but the extents returned by IDirect3DDevice2::GetClipStatus will not have been updated to account for the data rendered by this call.
D3DDP_OUTOFORDER A hint to the system that the primitives can be rendered out of order. Note that back-to-back calls to DrawPrimitive methods using this flag may cause triangles from the primitives to be interleaved. The DrawPrimitive methods that use this flag are Begin, BeginIndexed, DrawIndexedPrimitive, and DrawPrimitive.
D3DDP_WAIT Causes the method to wait until the polygons have been rendered before it returns, instead of returning as soon as the polygons have been sent to the card. (On scene-capture cards, the method returns as soon as the card responds.)

This flag is typically used for debugging. Applications should not attempt to use this flag to ensure that a scene is up-to-date before continuing.


Return Values

If the method succeeds, the return value is DD_OK.

If the method fails, the return value is an error. The method returns DDERR_INVALIDPARAMS if one of the arguments is invalid.

Remarks

This method fails if it is called after a call to the IDirect3DDevice2::Begin or IDirect3DDevice2::BeginIndexed method that has no bracketing call to IDirect3DDevice2::End method. Rendering calls that specify the wrong vertex type or that perform state changes will cause rendering of this primitive to fail.

This method was first introduced in the IDirect3DDevice2 interface.

QuickInfo

  Windows NT: Use version 5.0 or later.
  Windows: Use Windows 95 or later. Available as a redistributable for Windows 95.
  Windows CE: Unsupported.
  Header: Declared in d3d.h.
  Import Library: Use ddraw.lib.

See Also

IDirect3DDevice2::BeginIndexed, IDirect3DDevice2::End, IDirect3DDevice2::Vertex