Hi,
I'm trying to set float arrays to my HLSL parameter arrays.
Example:
The fx/effect file:
#define MaxPointLights 2
float3 PointLightPos[MaxPointLights];
In my code (C++) I achieve the expected resulted one of these 2 ways:
// one way
mEffect->SetFloatArray("PointLightPos[0]", myfloatarray, 3);
// another way
D3DXHANDLE param = mEffect->GetParameterElement("PointLightPos", 0);
mEffect->SetFloatArray(param, myfloatarray, 3);
Both ways work, where the 2nd is the most flexible (in the 1st one I need for hard code "PointLightPos[0]", [1] etc (or make a D3DXHANDLE adding strings etc.).
My question;
Is the 2nd option I do the best one, or is there a better/ easier way to set the element of a parameter in a d3dxeffect?