IDirect3DDevice3::BeginIndexed
The IDirect3DDevice3::BeginIndexed method defines the start of a primitive based on indexing into an array of vertices. This method fails if it is called after a call to the IDirect3DDevice3::Begin or IDirect3DDevice3::BeginIndexed method that has no corresponding call to IDirect3DDevice3::End. The only method you can legally call between calls to IDirect3DDevice3::BeginIndexed and IDirect3DDevice3::End is IDirect3DDevice3::Index.
HRESULT BeginIndexed(
D3DPRIMITIVETYPE dptPrimitiveType,
DWORD dwVertexTypeDesc,
LPVOID lpvVertices,
DWORD dwNumVertices,
DWORD dwFlags
);
Parameters
- dptPrimitiveType
- Type of primitive to be rendered by this command. This must be one of the members of the D3DPRIMITIVETYPE enumerated type. Note that the D3DPT_POINTLIST member of D3DPRIMITIVETYPE is not indexed.
- dwVertexTypeDesc
- A combination of flexible vertex format flags that describes the vertex format being used. Only vertices that match this type will be accepted before the corresponding IDirect3DDevice3::End.
- lpvVertices
- Pointer to the list of vertices to be used in the primitive sequence.
- dwNumVertices
- Number of vertices in the array at lpvVertices.
- 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_DONOTLIGHT
- Disables the Direct3D lighting engine. The system uses the diffuse and specular components at each vertex for shading when it rasterizes the set of primitives. If a diffuse or specular component is not specified, the system uses the default color for the missing component (0xFFFFFFFF for diffuse and 0x00000000 for specular).
- 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 IDirect3DDevice3::GetClipStatus will not have been updated to account for the data rendered by this call.
- 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 D3D_OK.
If the method fails, the return value may be one of the following values:
D3DERR_INVALIDRAMPTEXTURE |
Ramp mode is being used and the texture handle in the current material does not match the current texture handle that is set as a render state. |
DDERR_INVALIDPARAMS |
One of the arguments is invalid. |
Remarks
This method differs from its counterpart in the IDirect3DDevice2 interface in that it accepts a flexible vertex format descriptor rather than a member of the D3DVERTEXTYPE enumerated type as the second parameter. If you attempt to use one of the members of D3DVERTEXTYPE, the method fails, returning DDERR_INVALIDPARAMS. For more information, see Vertex Formats.
This method was first introduced in the IDirect3DDevice2 interface.
Windows NT/2000: Requires Windows 2000.
Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
Header: Declared in d3d.h.
Import Library: Use ddraw.lib.
See Also
IDirect3DDevice3::Begin, IDirect3DDevice3::End, IDirect3DDevice3::Index