DirectX SDK |
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 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;
Windows NT/2000: Requires Windows 2000.
Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
Windows CE: Unsupported.
Version: Requires DirectX 5.0 or later.
Header: Declared in d3d.h.