Vector Type Syntax
Microsoft DirectX 9.0 SDK Update (October 2004)

Vector Type Syntax


A vector is a special data type that contains between one and four components. Every component of a vector must be of the same type.

Syntax

Type Number VariableName

where:

TypeThe data type, which is one of the basic types.
NumberA positive integer that specifies the number of components. A vector must have at least one component, and can have no more than of four components.
VariableNameAn ASCII string that uniquely identifies the variable name.

Remarks

Here are some examples:

bool    bVector;   // scalar containing 1 Boolean
half2   hVector;   // vector containing 2 halfs
int1    iVector = 1;
float3  fVector = { 0.2f, 0.3f, 0.4f };

A vector can be declared using this syntax also:

vector <Type, Number> VariableName

Here are some examples:

vector <int,    1> iVector = 1;
vector <double, 4> dVector = { 0.2, 0.3, 0.4, 0.5 };


© 2004 Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center.