Microsoft DirectX 8.1 (C++) |
Loads data into the vertex shader constant memory.
D3DVSD_CONST( _ConstantAddress, _Count ) \ (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_CONSTMEM) | \ ((_Count) << D3DVSD_CONSTCOUNTSHIFT) | (_ConstantAddress))
The following code example shows how this macro might be used.
float diffuse[] = {1, 1, 1.0f/255.0f, 1}; DWORD decl[] = { D3DVSD_CONST(8, 1), *(DWORD*)&diffuse[0], *(DWORD*)&diffuse[1], *(DWORD*)&diffuse[2], *(DWORD*)&diffuse[3], D3DVSD_STREAM(0), D3DVSD_REG( 0, D3DVSDT_FLOAT3), D3DVSD_REG( 2, D3DVSDT_D3DCOLOR), D3DVSD_STREAM(1), D3DVSD_REG( 1, D3DVSDT_FLOAT1), D3DVSD_STREAM(2), D3DVSD_REG( 3, D3DVSDT_FLOAT2), D3DVSD_END() };
Header: Declared in D3d8types.h.