XNA Creators Club Online
foros de la comunidad
Page 1 of 1 (2 items)
Sort Posts: Previous Next

array in .fx?

Last post 23/06/2009 11:16 by XVincentX. 1 replies.
  • 21/06/2009 6:25

    array in .fx?

    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.
  • 23/06/2009 11:16 In reply to

    Re: array in .fx?

    Set int array?
Page 1 of 1 (2 items) Previous Next