<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.xna.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Direct3D 10 </title><link>http://forums.xna.com/forums/29.aspx</link><description>Only questions about the Direct3D 10 API are permitted here.</description><dc:language>en</dc:language><generator>CommunityServer 2007.1 (Build: 0.0)</generator><item><title>Re: array in .fx?</title><link>http://forums.xna.com/forums/thread/192578.aspx</link><pubDate>Tue, 23 Jun 2009 11:16:23 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:192578</guid><dc:creator>XVincentX</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/192578.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=29&amp;PostID=192578</wfw:commentRss><description>Set int array?&lt;br /&gt;</description></item><item><title>array in .fx?</title><link>http://forums.xna.com/forums/thread/191959.aspx</link><pubDate>Sun, 21 Jun 2009 06:25:18 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:191959</guid><dc:creator>gde</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/191959.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=29&amp;PostID=191959</wfw:commentRss><description>I actually would like to implement an array in my .fx file but having difficult to implement it.&lt;br /&gt;
&lt;br /&gt;
After i spend my time to read the sdk, i found that uses Buffer keyword.&lt;br /&gt;
I would like to use Buffer as global variable. Say, it is something like this.&lt;br /&gt;
// hlsl&lt;br /&gt;
Buffer&amp;lt;int&amp;gt; intArray;&lt;br /&gt;
&lt;br /&gt;
The value must be assigned before it is being used by VS() or PS() like another type like int, as scalar.&lt;br /&gt;
// C/C++&lt;br /&gt;
ID3D10Effect*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; peffect10;&lt;br /&gt;
ID3D10EffectScalarVariable*&amp;nbsp; pscalarVariable;&lt;br /&gt;
&lt;br /&gt;
pscalarVariable&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = peffect10-&amp;gt;GetVariableByName(&amp;quot;intTest&amp;quot;)-&amp;gt;AsScalar();&lt;br /&gt;
&lt;br /&gt;
// hlsl&lt;br /&gt;
int&amp;nbsp;&amp;nbsp; intTest;&lt;br /&gt;
&lt;br /&gt;
so i can easily assign a value to it by using this code.&lt;br /&gt;
// C/C++&lt;br /&gt;
pscalarVariable-&amp;gt;SetInt(10);&lt;br /&gt;
&lt;br /&gt;
but i wonder how to assign values into a buffer? perhaps you could gimme the example to doing that.   =)&lt;br /&gt;
or is there anyway how to implement an array in .fx?&lt;br /&gt;
&lt;br /&gt;
EDIT : &lt;br /&gt;
Not a fixed array that using brackets. &lt;br /&gt;
int testArray[10]. &lt;br /&gt;
&lt;br /&gt;
But it is dynamic.</description></item></channel></rss>