D3DXConvertMeshSubsetToStrips function

Convert the specified mesh subset into a series of strips.

Syntax

HRESULT D3DXConvertMeshSubsetToStrips(
  _In_  LPD3DXBASEMESH         MeshIn,
  _In_  DWORD                  AttribId,
  _In_  DWORD                  IBOptions,
  _Out_ LPDIRECT3DINDEXBUFFER9 *ppIndexBuffer,
  _Out_ DWORD                  *pNumIndices,
  _Out_ LPD3DXBUFFER           *ppStripLengths,
  _Out_ DWORD                  *pNumStrips
);

Parameters

MeshIn [in]

Type: LPD3DXBASEMESH

Pointer to an ID3DXBaseMesh interface, representing the mesh to convert to a strip.

AttribId [in]

Type: DWORD

Attribute ID of the mesh subset to convert to strips.

IBOptions [in]

Type: DWORD

Combination of one or more flags from the D3DXMESH enumeration, specifying options for creating the index buffer. Cannot be D3DXMESH_32BIT. The index buffer will be created with 32-bit or 16-bit indices depending on the format of the index buffer of the mesh specified by the MeshIn parameter.

ppIndexBuffer [out]

Type: LPDIRECT3DINDEXBUFFER9*

Pointer to an IDirect3DIndexBuffer9 interface, representing index buffer containing the strip.

pNumIndices [out]

Type: DWORD*

Number of indices in the buffer returned in the ppIndexBuffer parameter.

ppStripLengths [out]

Type: LPD3DXBUFFER*

Buffer containing an array of one DWORD per strip, which specifies the number of triangles in the that strip.

pNumStrips [out]

Type: DWORD*

Number of individual strips in the index buffer and corresponding strip length array.

Return value

Type: HRESULT

If the function succeeds, the return value is D3D_OK. If the function fails, the return value can be one of the following values: D3DERR_INVALIDCALL, E_OUTOFMEMORY.

Remarks

Before running this function, call Optimize or D3DXOptimizeFaces, with the D3DXMESHOPT_ATTRSORT flag set.

Requirements

Requirement Value
Header
D3DX9Mesh.h
Library
D3dx9.lib

See also

Mesh Functions