<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Managed DirectX C# Graphics Tutorial 2: Drawing a Triangle</title>
	<atom:link href="http://gregs-blog.com/2008/02/29/managed-directx-c-graphics-tutorial-2-drawing-a-triangle/feed/" rel="self" type="application/rss+xml" />
	<link>http://gregs-blog.com/2008/02/29/managed-directx-c-graphics-tutorial-2-drawing-a-triangle/</link>
	<description>A Blog about Graphics Programming, Game Programming, Tips and Tricks</description>
	<lastBuildDate>Mon, 16 Jan 2012 05:05:57 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Jens</title>
		<link>http://gregs-blog.com/2008/02/29/managed-directx-c-graphics-tutorial-2-drawing-a-triangle/#comment-2276</link>
		<dc:creator><![CDATA[Jens]]></dc:creator>
		<pubDate>Tue, 12 Jul 2011 13:33:13 +0000</pubDate>
		<guid isPermaLink="false">http://gregdolleysblog.wordpress.com/2008/02/29/managed-directx-c-graphics-tutorial-2-drawing-a-triangle/#comment-2276</guid>
		<description><![CDATA[Thank you for your Tutorial :)
I&#039;m a german student, but i understand your tutorial very well, i was searching a long time for a good tutorial, but now i found one :)

But on your 1st tutorial i have to say that your code only run @Net. Framework 3.5, maybe you can add this @beginning so other beginners hasn&#039;t this problem]]></description>
		<content:encoded><![CDATA[<p>Thank you for your Tutorial <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
I&#8217;m a german student, but i understand your tutorial very well, i was searching a long time for a good tutorial, but now i found one <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>But on your 1st tutorial i have to say that your code only run @Net. Framework 3.5, maybe you can add this @beginning so other beginners hasn&#8217;t this problem</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gregd1024</title>
		<link>http://gregs-blog.com/2008/02/29/managed-directx-c-graphics-tutorial-2-drawing-a-triangle/#comment-2155</link>
		<dc:creator><![CDATA[gregd1024]]></dc:creator>
		<pubDate>Mon, 17 Jan 2011 04:53:09 +0000</pubDate>
		<guid isPermaLink="false">http://gregdolleysblog.wordpress.com/2008/02/29/managed-directx-c-graphics-tutorial-2-drawing-a-triangle/#comment-2155</guid>
		<description><![CDATA[Thank you, Ram. :)]]></description>
		<content:encoded><![CDATA[<p>Thank you, Ram. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ram Raddhakrishnan</title>
		<link>http://gregs-blog.com/2008/02/29/managed-directx-c-graphics-tutorial-2-drawing-a-triangle/#comment-2154</link>
		<dc:creator><![CDATA[Ram Raddhakrishnan]]></dc:creator>
		<pubDate>Sun, 16 Jan 2011 19:30:18 +0000</pubDate>
		<guid isPermaLink="false">http://gregdolleysblog.wordpress.com/2008/02/29/managed-directx-c-graphics-tutorial-2-drawing-a-triangle/#comment-2154</guid>
		<description><![CDATA[Thank you for a clearly written, handy tutorial.
It has just the right ingredients to satisfy my impatience - a bit of linear algebra as it relates to 3D transforms, just enough C++ and sufficient C#. I could not have asked for a more balance recipe!.]]></description>
		<content:encoded><![CDATA[<p>Thank you for a clearly written, handy tutorial.<br />
It has just the right ingredients to satisfy my impatience &#8211; a bit of linear algebra as it relates to 3D transforms, just enough C++ and sufficient C#. I could not have asked for a more balance recipe!.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jay</title>
		<link>http://gregs-blog.com/2008/02/29/managed-directx-c-graphics-tutorial-2-drawing-a-triangle/#comment-2011</link>
		<dc:creator><![CDATA[Jay]]></dc:creator>
		<pubDate>Fri, 15 Oct 2010 14:43:41 +0000</pubDate>
		<guid isPermaLink="false">http://gregdolleysblog.wordpress.com/2008/02/29/managed-directx-c-graphics-tutorial-2-drawing-a-triangle/#comment-2011</guid>
		<description><![CDATA[Read your Tutorial, getting this result: http://a00.img-up.net/?up=strangeo9j6d.jpg

MS Visual C# 2010
MS DirectX SDK June 2010

Wtf is this? No Warnings or Errors while compiling...]]></description>
		<content:encoded><![CDATA[<p>Read your Tutorial, getting this result: <a href="http://a00.img-up.net/?up=strangeo9j6d.jpg" rel="nofollow">http://a00.img-up.net/?up=strangeo9j6d.jpg</a></p>
<p>MS Visual C# 2010<br />
MS DirectX SDK June 2010</p>
<p>Wtf is this? No Warnings or Errors while compiling&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shome24</title>
		<link>http://gregs-blog.com/2008/02/29/managed-directx-c-graphics-tutorial-2-drawing-a-triangle/#comment-2010</link>
		<dc:creator><![CDATA[shome24]]></dc:creator>
		<pubDate>Sun, 10 Oct 2010 16:35:53 +0000</pubDate>
		<guid isPermaLink="false">http://gregdolleysblog.wordpress.com/2008/02/29/managed-directx-c-graphics-tutorial-2-drawing-a-triangle/#comment-2010</guid>
		<description><![CDATA[Dear All,

I don&#039;t have &quot;vector4&quot;  object in my system,
which dll can I download to get it?

Shmuel]]></description>
		<content:encoded><![CDATA[<p>Dear All,</p>
<p>I don&#8217;t have &#8220;vector4&#8243;  object in my system,<br />
which dll can I download to get it?</p>
<p>Shmuel</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Till</title>
		<link>http://gregs-blog.com/2008/02/29/managed-directx-c-graphics-tutorial-2-drawing-a-triangle/#comment-1642</link>
		<dc:creator><![CDATA[Till]]></dc:creator>
		<pubDate>Wed, 30 Sep 2009 06:14:40 +0000</pubDate>
		<guid isPermaLink="false">http://gregdolleysblog.wordpress.com/2008/02/29/managed-directx-c-graphics-tutorial-2-drawing-a-triangle/#comment-1642</guid>
		<description><![CDATA[Robert uses an older DirectX version !]]></description>
		<content:encoded><![CDATA[<p>Robert uses an older DirectX version !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gregd1024</title>
		<link>http://gregs-blog.com/2008/02/29/managed-directx-c-graphics-tutorial-2-drawing-a-triangle/#comment-527</link>
		<dc:creator><![CDATA[gregd1024]]></dc:creator>
		<pubDate>Sun, 25 Jan 2009 17:34:16 +0000</pubDate>
		<guid isPermaLink="false">http://gregdolleysblog.wordpress.com/2008/02/29/managed-directx-c-graphics-tutorial-2-drawing-a-triangle/#comment-527</guid>
		<description><![CDATA[Robert - hmmmm, maybe DirectX changed this in your version, but mine works fine just by setting the Position property directly. Thanks for the additional code.

-Greg]]></description>
		<content:encoded><![CDATA[<p>Robert &#8211; hmmmm, maybe DirectX changed this in your version, but mine works fine just by setting the Position property directly. Thanks for the additional code.</p>
<p>-Greg</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert</title>
		<link>http://gregs-blog.com/2008/02/29/managed-directx-c-graphics-tutorial-2-drawing-a-triangle/#comment-518</link>
		<dc:creator><![CDATA[Robert]]></dc:creator>
		<pubDate>Mon, 19 Jan 2009 15:43:16 +0000</pubDate>
		<guid isPermaLink="false">http://gregdolleysblog.wordpress.com/2008/02/29/managed-directx-c-graphics-tutorial-2-drawing-a-triangle/#comment-518</guid>
		<description><![CDATA[There is an error here to do with the vertices. Each should be changed to:-

vertexes[0].SetPosition( new Vector4(50, 50, 0, 1.0f));
vertexes[0].Color = System.Drawing.Color.FromArgb(0, 255, 0).ToArgb();

While I am here, can I suggest to others working through this tutorial (which I think is excellent) that you can experiment with values, inputting values into the running application by doing the following.

1. Create a standard C# windows application.
     a. in the window add a &#039;Panel&#039; (in the example below it&#039;s name is &#039;panelDraw&#039;)
     b. Now you can add textboxes and values around this and a Button to redraw with new values (include an information box so that you can feed back infortion on values to yourself).
2. As stated in the first tutorial add refferences for DirectX and DirectX3d
3. Add &#039;using&#039; statements at the top of your source.
     using Microsoft.DirectX;
     using Microsoft.DirectX.Direct3D;
4. Add the device to the class
     private Device m_device = null;

Example
namespace graphclassws
{
    public partial class Form1 : Form
    {
        private Device m_device = null;
        public Form1()
        {
            InitializeComponent();
            InitGraphics();
        }

        private void InitGraphics()
        {
            PresentParameters present_params = new PresentParameters();
            present_params.Windowed = true;
            present_params.SwapEffect = SwapEffect.Discard;
            //&lt;em&gt;panelDraw&lt;/em&gt; is our Panel control
            m_device = new Device(0, DeviceType.Hardware, panelDraw, CreateFlags.SoftwareVertexProcessing, present_params);

        }

.....rest of class ....

So using code up to the second in greg&#039;s tutorial our trigger button may look like this.

private void btnFindPointOnLine_Click(object sender, EventArgs e)
        {
         //clear our device surface
            m_device.Clear(ClearFlags.Target, System.Drawing.Color.FromArgb(0, 0, 255).ToArgb(), 1.0f, 0);
         //create array of vertexes
            CustomVertex.TransformedColored[] vertexes = new CustomVertex.TransformedColored[3];

           
            //initialize vertexes
            vertexes[0].SetPosition( new Vector4(50, 50, 0, 1.0f));
            vertexes[0].Color = System.Drawing.Color.FromArgb(0, 255, 0).ToArgb();

            vertexes[1].SetPosition( new Vector4(250, 50, 0, 1.0f));
            vertexes[1].Color = System.Drawing.Color.FromArgb(0, 0, 255).ToArgb();

            vertexes[2].SetPosition( new Vector4(50, 250, 0, 1.0f));
            vertexes[2].Color = System.Drawing.Color.FromArgb(255, 0, 0).ToArgb();

            
            //draw our surface
            m_device.BeginScene();
            m_device.VertexFormat = CustomVertex.TransformedColored.Format;
            m_device.DrawUserPrimitives(PrimitiveType.TriangleList, 1, vertexes);
            m_device.EndScene();
            m_device.Present();
        }


This helps you to work along through these tutorials, and experiment with the running code.]]></description>
		<content:encoded><![CDATA[<p>There is an error here to do with the vertices. Each should be changed to:-</p>
<p>vertexes[0].SetPosition( new Vector4(50, 50, 0, 1.0f));<br />
vertexes[0].Color = System.Drawing.Color.FromArgb(0, 255, 0).ToArgb();</p>
<p>While I am here, can I suggest to others working through this tutorial (which I think is excellent) that you can experiment with values, inputting values into the running application by doing the following.</p>
<p>1. Create a standard C# windows application.<br />
     a. in the window add a &#8216;Panel&#8217; (in the example below it&#8217;s name is &#8216;panelDraw&#8217;)<br />
     b. Now you can add textboxes and values around this and a Button to redraw with new values (include an information box so that you can feed back infortion on values to yourself).<br />
2. As stated in the first tutorial add refferences for DirectX and DirectX3d<br />
3. Add &#8216;using&#8217; statements at the top of your source.<br />
     using Microsoft.DirectX;<br />
     using Microsoft.DirectX.Direct3D;<br />
4. Add the device to the class<br />
     private Device m_device = null;</p>
<p>Example<br />
namespace graphclassws<br />
{<br />
    public partial class Form1 : Form<br />
    {<br />
        private Device m_device = null;<br />
        public Form1()<br />
        {<br />
            InitializeComponent();<br />
            InitGraphics();<br />
        }</p>
<p>        private void InitGraphics()<br />
        {<br />
            PresentParameters present_params = new PresentParameters();<br />
            present_params.Windowed = true;<br />
            present_params.SwapEffect = SwapEffect.Discard;<br />
            //<em>panelDraw</em> is our Panel control<br />
            m_device = new Device(0, DeviceType.Hardware, panelDraw, CreateFlags.SoftwareVertexProcessing, present_params);</p>
<p>        }</p>
<p>&#8230;..rest of class &#8230;.</p>
<p>So using code up to the second in greg&#8217;s tutorial our trigger button may look like this.</p>
<p>private void btnFindPointOnLine_Click(object sender, EventArgs e)<br />
        {<br />
         //clear our device surface<br />
            m_device.Clear(ClearFlags.Target, System.Drawing.Color.FromArgb(0, 0, 255).ToArgb(), 1.0f, 0);<br />
         //create array of vertexes<br />
            CustomVertex.TransformedColored[] vertexes = new CustomVertex.TransformedColored[3];</p>
<p>            //initialize vertexes<br />
            vertexes[0].SetPosition( new Vector4(50, 50, 0, 1.0f));<br />
            vertexes[0].Color = System.Drawing.Color.FromArgb(0, 255, 0).ToArgb();</p>
<p>            vertexes[1].SetPosition( new Vector4(250, 50, 0, 1.0f));<br />
            vertexes[1].Color = System.Drawing.Color.FromArgb(0, 0, 255).ToArgb();</p>
<p>            vertexes[2].SetPosition( new Vector4(50, 250, 0, 1.0f));<br />
            vertexes[2].Color = System.Drawing.Color.FromArgb(255, 0, 0).ToArgb();</p>
<p>            //draw our surface<br />
            m_device.BeginScene();<br />
            m_device.VertexFormat = CustomVertex.TransformedColored.Format;<br />
            m_device.DrawUserPrimitives(PrimitiveType.TriangleList, 1, vertexes);<br />
            m_device.EndScene();<br />
            m_device.Present();<br />
        }</p>
<p>This helps you to work along through these tutorials, and experiment with the running code.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

