I actually would like to implement an array in my .fx file but having difficult to implement it.
After i spend my time to read the sdk, i found that uses Buffer keyword.
I would like to use Buffer as global variable. Say, it is something like this.
// hlsl
Buffer<int> intArray;
The value must be assigned before it is being used by VS() or PS() like another type like int, as scalar.
// C/C++
ID3D10Effect* peffect10;
ID3D10EffectScalarVariable* pscalarVariable;
pscalarVariable = peffect10->GetVariableByName("intTest")->AsScalar();
// hlsl
int intTest;
so i can easily assign a value to it by using this code.
// C/C++
pscalarVariable->SetInt(10);
but i wonder how to assign values into a buffer? perhaps you could gimme the example to doing that. =)
or is there anyway how to implement an array in .fx?
EDIT :
Not a fixed array that using brackets.
int testArray[10].
But it is dynamic.