D3DMATRIX (D3D_OVERLOADS)

The D3D_OVERLOADS implementation of the D3DMATRIX structure implements a parentheses ("()") operator. This operator offers convenient access to values in the matrix for C++ programmers. Instead of having to refer to the structure members by name, C++ programmers can refer to them by row and column number, and simply index these numbers as needed.

typedef struct _D3DMATRIX {

#if (defined __cplusplus) && (defined D3D_OVERLOADS)

union {

struct {

#endif

D3DVALUE _11, _12, _13, _14;

D3DVALUE _21, _22, _23, _24;

D3DVALUE _31, _32, _33, _34;

D3DVALUE _41, _42, _43, _44;

#if (defined __cplusplus) && (defined D3D_OVERLOADS)

};

D3DVALUE m[4][4];

};

_D3DMATRIX() { }

D3DVALUE& operator()(int iRow, int iColumn) { return m[iRow][iColumn]; }

const D3DVALUE& operator()(int iRow, int iColumn) const { return m[iRow][iColumn]; }

#endif

} D3DMATRIX, *LPD3DMATRIX;

See Also

D3DMATRIX