Microsoft DirectX 8.0 (Visual Basic) |
Template members consist of a named data type followed by an optional name or an array of a named data type. Valid primitive data types are defined in the following table.
Type | Size |
---|---|
WORD | 16 bits |
DWORD | 32 bits |
FLOAT | IEEE float |
DOUBLE | 64 bits |
CHAR | 8 bits |
UCHAR | 8 bits |
BYTE | 8 bits |
STRING | NULL terminated string |
CSTRING | Formatted C string (not supported) |
UNICODE | Unicode™ string (not supported) |
Additional data types defined by templates encountered earlier in the data stream can also be referenced within a template definition. No forward references are allowed.
Any valid data type can be expressed as an array in the template definition. The basic syntax is shown in the following example.
array <data-type> <name>[<dimension-size>];
<dimension-size> can either be an integer or a named reference to another template member whose value is then substituted. Arrays can be n-dimensional, where n is determined by the number of paired square brackets trailing the statement, as in the following example.
array DWORD FixedHerd[24]; array DWORD Herd[nCows]; array FLOAT Matrix4x4[4][4];