Game Development Reference
In-Depth Information
Sets a floating-point variable in
the effect file identified by
hParameter
to the value
f
HRESULT ID3DXEffect::SetFloat(
D3DXHANDLE hParameter,
FLOAT f
);
Sets a matrix variable in the effect
file identified by
hParameter
to the
value pointed to by
pMatrix
HRESULT ID3DXEffect::SetMatrix(
D3DXHANDLE hParameter,
CONST D3DXMATRIX* pMatrix
);
Sets a matrix variable in the effect
file identified by
hParameter
to the
value pointed to by
pString
HRESULT ID3DXEffect::SetString(
D3DXHANDLE hParameter,
CONST LPCSTR pString
);
Sets a texture variable in the effect
file identified by
hParameter
to the
value pointed to by
pTexture
HRESULT ID3DXEffect::SetTexture(
D3DXHANDLE hParameter,
LPDIRECT3DBASETEXTURE9 pTexture
);
Sets a vector variable in the effect
file identified by
hParameter
to the
value pointed to by
pVector
HRESULT ID3DXEffect::SetVector(
D3DXHANDLE hParameter,
CONST D3DXVECTOR4* pVector
);
Sets a vertex shader variable in
the effect file identified by
hParameter
to the value pointed
to by
pVertexShader
HRESULT ID3DXEffect::SetVertexShader(
D3DXHANDLE hParameter,
LPDIRECT3DVERTEXSHADER9
pVertexShader
);
Sets a pixel shader variable in the
effect file identified by
hParameter
to the value pointed to by
pPShader
HRESULT ID3DXEffect::SetPixelShader(
D3DXHANDLE hParameter,
LPDIRECT3DPIXELSHADER9 pPShader
);
We obtain handles to variables (also called effect parameters) using the
following method:
D3DXHANDLE ID3DXEffect::GetParameterByName(
D3DXHANDLE hParent, // scope of variable - parent structure
LPCSTR pName
// name of variable
);
Its signature is the same as the
ID3DXConstantTable::GetCon-
stantByName
method. Namely, the first parameter is a
D3DXHANDLE
that identifies the parent structure in which the variable we want a han-
dle to lives. For global variables that have no parent structure, we
specify null. The second parameter is the name of the variable as it
appears in the effect file.
Search WWH ::
Custom Search