IDirect3DVertexDeclaration9::GetDeclaration method (d3d9helper.h)
Gets the vertex shader declaration.
Syntax
HRESULT GetDeclaration(
D3DVERTEXELEMENT9 *unnamedParam1,
UINT *pNumElements
);
Parameters
unnamedParam1
pNumElements
Type: [out] UINT*
Number of elements in the array. The application needs to allocate enough room for this.
Return value
Type: HRESULT
If the method succeeds, the return value is D3D_OK. If the method fails, the return value can be D3DERR_INVALIDCALL.
Remarks
The number of elements, pNumElements, includes the D3DDECL_END macro, which ends the declaration. So the element count is actually one higher than the number of valid vertex elements.
Here's an example that will return the vertex declaration array of up to 256 elements:
D3DVERTEXELEMENT9 decl[MAXD3DDECLLENGTH];
UINT numElements;
HRESULT hr = m_pVertexDeclaration->GetDeclaration( decl, &numElements);
Specify NULL for pDeclto get the number of elements in the declaration.
Requirements
Requirement | Value |
---|---|
Target Platform | Windows |
Header | d3d9helper.h (include D3D9.h) |
Library | D3D9.lib |