ID3DXFile::RegisterTemplates method
Registers custom templates.
Syntax
HRESULT RegisterTemplates(
[in] LPCVOID pvData,
[in] SIZE_T cbSize
);
Parameters
-
pvData [in]
-
Type: LPCVOID
Pointer to a buffer consisting of a .x file in text or binary format that contains templates.
-
cbSize [in]
-
Type: SIZE_T
Size of the buffer pointed to by pvData, in bytes.
Return value
Type: HRESULT
If the method succeeds, the return value is S_OK. If the method fails, the return value can be one of the following: D3DXFERR_BADVALUE, D3DXFERR_PARSEERROR.
Remarks
The following code fragment provides an example call to RegisterTemplates And example contents for the buffer to which pvData points.
#define XSKINEXP_TEMPLATES \
"xof 0303txt 0032\
template XSkinMeshHeader \
{ \
<3CF169CE-FF7C-44ab-93C0-F78F62D172E2> \
WORD nMaxSkinWeightsPerVertex; \
WORD nMaxSkinWeightsPerFace; \
WORD nBones; \
} \
template VertexDuplicationIndices \
{ \
<B8D65549-D7C9-4995-89CF-53A9A8B031E3> \
DWORD nIndices; \
DWORD nOriginalVertices; \
array DWORD indices[nIndices]; \
} \
template SkinWeights \
{ \
<6F0D123B-BAD2-4167-A0D0-80224F25FABB> \
STRING transformNodeName;\
DWORD nWeights; \
array DWORD vertexIndices[nWeights]; \
array float weights[nWeights]; \
Matrix4x4 matrixOffset; \
}"
.
.
.
LPD3DXFILE pD3DXFile = NULL;
if ( FAILED
(hr = pD3DXFile->RegisterTemplates(
(LPVOID)XSKINEXP_TEMPLATES,
sizeof( XSKINEXP_TEMPLATES ) - 1 ) ) )
goto End;
All templates must specify a name and a UUID.
This method calls the RegisterEnumTemplates method, obtaining an ID3DXFileEnumObject interface pointer by calling CreateEnumObject with pvData as the first parameter.
Requirements
Requirement | Value |
---|---|
Header |
|
Library |
|
See also