Microsoft DirectX 8.1 (Visual Basic) |
Loads data into the vertex shader constant memory.
Function D3DVSD_CONST(ConstantAddress As Long, Count As Long) As Long D3DVSD_CONST = (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_constMEM) Or _ ((Count) * 2 ^ D3DVSD_CONSTCOUNTSHIFT) Or (ConstantAddress)) End Function
D3DVSD_CONST and all the constants it uses are found in (SDK Root)\Samples\Multimedia\VBSamples\Common\D3DShaders.bas.
The following code example shows how this function might be used.
Dim Declarator(12) As Long Declarator(0) = D3DVSD_CONST(8, 1) Declarator(1) = FtoDW(1) Declarator(2) = FtoDW(1) Declarator(3) = FtoDW(1/255) Declarator(4) = FtoDW(1) Declarator(5) = D3DVSD_STREAM(0) Declarator(6) = D3DVSD_REG(0, D3DVSDT_FLOAT3) Declarator(7) = D3DVSD_REG(2, D3DVSDT_D3DCOLOR) Declarator(8) = D3DVSD_STREAM(1) Declarator(9) = D3DVSD_REG(1, D3DVSDT_FLOAT1) Declarator(10) = D3DVSD_STREAM(2) Declarator(11) = D3DVSD_REG(3, D3DVSDT_FLOAT2) Declarator(12) = D3DVSD_END()