<?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: DirectX 9 C++ Graphics Tutorial 2: Drawing a Triangle</title>
	<atom:link href="http://gregs-blog.com/2008/02/28/directx-9-c-graphics-tutorial-2-drawing-a-triangle/feed/" rel="self" type="application/rss+xml" />
	<link>http://gregs-blog.com/2008/02/28/directx-9-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: Etni</title>
		<link>http://gregs-blog.com/2008/02/28/directx-9-c-graphics-tutorial-2-drawing-a-triangle/#comment-2023</link>
		<dc:creator><![CDATA[Etni]]></dc:creator>
		<pubDate>Tue, 26 Oct 2010 12:10:01 +0000</pubDate>
		<guid isPermaLink="false">http://gregdolleysblog.wordpress.com/2008/02/28/directx-9-c-graphics-tutorial-2-drawing-a-triangle/#comment-2023</guid>
		<description><![CDATA[Hi and thanks for another great tutorial!

A tip from the perspective of a complete newbie; you could try to avoid structures that are not required for the program to run (and if you feel these should be included, get to it at later tutorials when the reader has a better idea of what he is doing).

For example, I found:
&lt;code&gt;
pVertexObject-&gt;Lock(0, 3*sizeof(D3DVERTEX), &amp;pVertexBuffer, 0)
&lt;/code&gt;

easier to understand than:
&lt;code&gt;
if(FAILED(pVertexObject-&gt;Lock(0, 3*sizeof(D3DVERTEX), &amp;pVertexBuffer, 0)))
   return(0);
&lt;/code&gt;

because the code doesn&#039;t fail anyway, whatever that means. And the above can be used in void functions etc.


Cheers :)]]></description>
		<content:encoded><![CDATA[<p>Hi and thanks for another great tutorial!</p>
<p>A tip from the perspective of a complete newbie; you could try to avoid structures that are not required for the program to run (and if you feel these should be included, get to it at later tutorials when the reader has a better idea of what he is doing).</p>
<p>For example, I found:<br />
<code><br />
pVertexObject-&gt;Lock(0, 3*sizeof(D3DVERTEX), &amp;pVertexBuffer, 0)<br />
</code></p>
<p>easier to understand than:<br />
<code><br />
if(FAILED(pVertexObject-&gt;Lock(0, 3*sizeof(D3DVERTEX), &amp;pVertexBuffer, 0)))<br />
   return(0);<br />
</code></p>
<p>because the code doesn&#8217;t fail anyway, whatever that means. And the above can be used in void functions etc.</p>
<p>Cheers <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Islam Al-Rayan</title>
		<link>http://gregs-blog.com/2008/02/28/directx-9-c-graphics-tutorial-2-drawing-a-triangle/#comment-1934</link>
		<dc:creator><![CDATA[Islam Al-Rayan]]></dc:creator>
		<pubDate>Wed, 25 Aug 2010 03:16:28 +0000</pubDate>
		<guid isPermaLink="false">http://gregdolleysblog.wordpress.com/2008/02/28/directx-9-c-graphics-tutorial-2-drawing-a-triangle/#comment-1934</guid>
		<description><![CDATA[I believe you&#039;re using the Unicode Character Set
Try to use the Multi-Byte Character Set
since I think it&#039;s the default for this tutorial :)

Property Page-&gt; Configuration properties -&gt; General -&gt; Character Set &quot;change it to Multi-Byte&quot;]]></description>
		<content:encoded><![CDATA[<p>I believe you&#8217;re using the Unicode Character Set<br />
Try to use the Multi-Byte Character Set<br />
since I think it&#8217;s the default for this tutorial <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Property Page-&gt; Configuration properties -&gt; General -&gt; Character Set &#8220;change it to Multi-Byte&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Benjamin</title>
		<link>http://gregs-blog.com/2008/02/28/directx-9-c-graphics-tutorial-2-drawing-a-triangle/#comment-1711</link>
		<dc:creator><![CDATA[Benjamin]]></dc:creator>
		<pubDate>Tue, 19 Jan 2010 00:59:44 +0000</pubDate>
		<guid isPermaLink="false">http://gregdolleysblog.wordpress.com/2008/02/28/directx-9-c-graphics-tutorial-2-drawing-a-triangle/#comment-1711</guid>
		<description><![CDATA[Your vertex buffer can have vertices that aren&#039;t connected.  Go ahead and put your 64 sets of squares in there using a couple nested loops.

You can use the triangle strip method of drawing in a 64x loop to draw them all:
&lt;code&gt; 
for (int i=0; iDrawPrimitive( D3DPT_TRIANGLESTRIP, i*4, 4 );
}
&lt;/code&gt;]]></description>
		<content:encoded><![CDATA[<p>Your vertex buffer can have vertices that aren&#8217;t connected.  Go ahead and put your 64 sets of squares in there using a couple nested loops.</p>
<p>You can use the triangle strip method of drawing in a 64x loop to draw them all:<br />
<code><br />
for (int i=0; iDrawPrimitive( D3DPT_TRIANGLESTRIP, i*4, 4 );<br />
}<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jayson</title>
		<link>http://gregs-blog.com/2008/02/28/directx-9-c-graphics-tutorial-2-drawing-a-triangle/#comment-1676</link>
		<dc:creator><![CDATA[jayson]]></dc:creator>
		<pubDate>Wed, 04 Nov 2009 03:07:55 +0000</pubDate>
		<guid isPermaLink="false">http://gregdolleysblog.wordpress.com/2008/02/28/directx-9-c-graphics-tutorial-2-drawing-a-triangle/#comment-1676</guid>
		<description><![CDATA[I am thinking that I should be using Sprites? Am I Correct?]]></description>
		<content:encoded><![CDATA[<p>I am thinking that I should be using Sprites? Am I Correct?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jayson</title>
		<link>http://gregs-blog.com/2008/02/28/directx-9-c-graphics-tutorial-2-drawing-a-triangle/#comment-1675</link>
		<dc:creator><![CDATA[jayson]]></dc:creator>
		<pubDate>Wed, 04 Nov 2009 03:03:49 +0000</pubDate>
		<guid isPermaLink="false">http://gregdolleysblog.wordpress.com/2008/02/28/directx-9-c-graphics-tutorial-2-drawing-a-triangle/#comment-1675</guid>
		<description><![CDATA[I was able to create 2 triangles to make a box ( FINALLY! thanks alot), but what if i wanted to create a full checkerboard what would be the best way to do that? I know that there is a better way then creating that many triangles.  Maybe create 1 black/white pair and then &quot;copy&quot; it across the board.  Thanks alot.]]></description>
		<content:encoded><![CDATA[<p>I was able to create 2 triangles to make a box ( FINALLY! thanks alot), but what if i wanted to create a full checkerboard what would be the best way to do that? I know that there is a better way then creating that many triangles.  Maybe create 1 black/white pair and then &#8220;copy&#8221; it across the board.  Thanks alot.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter</title>
		<link>http://gregs-blog.com/2008/02/28/directx-9-c-graphics-tutorial-2-drawing-a-triangle/#comment-611</link>
		<dc:creator><![CDATA[Peter]]></dc:creator>
		<pubDate>Thu, 02 Apr 2009 04:11:31 +0000</pubDate>
		<guid isPermaLink="false">http://gregdolleysblog.wordpress.com/2008/02/28/directx-9-c-graphics-tutorial-2-drawing-a-triangle/#comment-611</guid>
		<description><![CDATA[If you&#039;re looking for a timer the easiest way is just to create a form in your project and set visible to false, and set the location waaay of screen, like 3000,3000. Then you add a timer to your form and voila! a very accurate timer that takes 30 seconds to set up:P

Regards, Peter]]></description>
		<content:encoded><![CDATA[<p>If you&#8217;re looking for a timer the easiest way is just to create a form in your project and set visible to false, and set the location waaay of screen, like 3000,3000. Then you add a timer to your form and voila! a very accurate timer that takes 30 seconds to set up:P</p>
<p>Regards, Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TyPR</title>
		<link>http://gregs-blog.com/2008/02/28/directx-9-c-graphics-tutorial-2-drawing-a-triangle/#comment-579</link>
		<dc:creator><![CDATA[TyPR]]></dc:creator>
		<pubDate>Thu, 05 Mar 2009 03:20:13 +0000</pubDate>
		<guid isPermaLink="false">http://gregdolleysblog.wordpress.com/2008/02/28/directx-9-c-graphics-tutorial-2-drawing-a-triangle/#comment-579</guid>
		<description><![CDATA[Ok, sorry about the double post, but I did figure out how to force a redraw

For anyone that wants to know:
InvalidateRect(NULL, hWindowHandle, FALSE)

Anyway, now I&#039;m looking for an accurate timing system to force redraws every set number of milliseconds. Anything in ctime.h goes by seconds, and clock() uses a preset (unaccurate) measure that basically makes it a really fast frame counter. I&#039;ll probly be able to find one myself, but just wanted to let you know I solved my original problem :)

BTW thanks again for the tutorial]]></description>
		<content:encoded><![CDATA[<p>Ok, sorry about the double post, but I did figure out how to force a redraw</p>
<p>For anyone that wants to know:<br />
InvalidateRect(NULL, hWindowHandle, FALSE)</p>
<p>Anyway, now I&#8217;m looking for an accurate timing system to force redraws every set number of milliseconds. Anything in ctime.h goes by seconds, and clock() uses a preset (unaccurate) measure that basically makes it a really fast frame counter. I&#8217;ll probly be able to find one myself, but just wanted to let you know I solved my original problem <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>BTW thanks again for the tutorial</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TyPR</title>
		<link>http://gregs-blog.com/2008/02/28/directx-9-c-graphics-tutorial-2-drawing-a-triangle/#comment-577</link>
		<dc:creator><![CDATA[TyPR]]></dc:creator>
		<pubDate>Wed, 04 Mar 2009 21:42:46 +0000</pubDate>
		<guid isPermaLink="false">http://gregdolleysblog.wordpress.com/2008/02/28/directx-9-c-graphics-tutorial-2-drawing-a-triangle/#comment-577</guid>
		<description><![CDATA[Thanks.

Also, through playing around a lot, I have some more questions.

First, I am currently having a problem with one of either two things. I&#039;m guessing the problem is that the window never redraws itself (unless I resize it). Is there a way to change this? Also, will this work for getting the r/g/b/a values of a color?

&lt;code&gt;union
{
  DWORD color;
  struct { BYTE r, g, b, a; }; //Does alpha come first or last?
};&lt;/code&gt;

I&#039;m guessing my first question should solve my problem. If it doesn&#039;t then I&#039;m guessing either the union is wrong or theres something messing me up with my multithreading (I have one thread for drawing and one for the game loop... though at this point I doubt its the problem)]]></description>
		<content:encoded><![CDATA[<p>Thanks.</p>
<p>Also, through playing around a lot, I have some more questions.</p>
<p>First, I am currently having a problem with one of either two things. I&#8217;m guessing the problem is that the window never redraws itself (unless I resize it). Is there a way to change this? Also, will this work for getting the r/g/b/a values of a color?</p>
<p><code>union<br />
{<br />
  DWORD color;<br />
  struct { BYTE r, g, b, a; }; //Does alpha come first or last?<br />
};</code></p>
<p>I&#8217;m guessing my first question should solve my problem. If it doesn&#8217;t then I&#8217;m guessing either the union is wrong or theres something messing me up with my multithreading (I have one thread for drawing and one for the game loop&#8230; though at this point I doubt its the problem)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gregd1024</title>
		<link>http://gregs-blog.com/2008/02/28/directx-9-c-graphics-tutorial-2-drawing-a-triangle/#comment-575</link>
		<dc:creator><![CDATA[gregd1024]]></dc:creator>
		<pubDate>Tue, 03 Mar 2009 08:49:28 +0000</pubDate>
		<guid isPermaLink="false">http://gregdolleysblog.wordpress.com/2008/02/28/directx-9-c-graphics-tutorial-2-drawing-a-triangle/#comment-575</guid>
		<description><![CDATA[TyPR - pVertexObject is not the same as pVertexBuffer. pVertexObject is actually an interface that has functions for working with vertices (such as Lock(), which allocates vertex buffers). pVertexBuffer is just a pointer to your vertex data. And, yes, the value of pVertexBuffer will stay the same unless you acquire a new lock on it.

-Greg Dolley]]></description>
		<content:encoded><![CDATA[<p>TyPR &#8211; pVertexObject is not the same as pVertexBuffer. pVertexObject is actually an interface that has functions for working with vertices (such as Lock(), which allocates vertex buffers). pVertexBuffer is just a pointer to your vertex data. And, yes, the value of pVertexBuffer will stay the same unless you acquire a new lock on it.</p>
<p>-Greg Dolley</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TyPR</title>
		<link>http://gregs-blog.com/2008/02/28/directx-9-c-graphics-tutorial-2-drawing-a-triangle/#comment-563</link>
		<dc:creator><![CDATA[TyPR]]></dc:creator>
		<pubDate>Sat, 28 Feb 2009 06:54:28 +0000</pubDate>
		<guid isPermaLink="false">http://gregdolleysblog.wordpress.com/2008/02/28/directx-9-c-graphics-tutorial-2-drawing-a-triangle/#comment-563</guid>
		<description><![CDATA[Hey, nice tutorial. Thanks :)

I just have one question. You create pVertexObject and pVertexBuffer, and then lock pVertexObject, which gives you a pointer to where to write to the buffer. My question is: are pObject and pBuffer not the same? (I would guess not if it requires both of them). I&#039;m guessing pObject points to some type of struct/class/other data that DirectX uses (basically a header for the actual vertex buffer data), and pBuffer points to where the actual data is?

Also, once pBuffer has a value (and as long as you don&#039;t resize pObject), will that value always be the same?

Lol I know I&#039;m probly a pain but just wondering. Thanks for the tutorials again! :)]]></description>
		<content:encoded><![CDATA[<p>Hey, nice tutorial. Thanks <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I just have one question. You create pVertexObject and pVertexBuffer, and then lock pVertexObject, which gives you a pointer to where to write to the buffer. My question is: are pObject and pBuffer not the same? (I would guess not if it requires both of them). I&#8217;m guessing pObject points to some type of struct/class/other data that DirectX uses (basically a header for the actual vertex buffer data), and pBuffer points to where the actual data is?</p>
<p>Also, once pBuffer has a value (and as long as you don&#8217;t resize pObject), will that value always be the same?</p>
<p>Lol I know I&#8217;m probly a pain but just wondering. Thanks for the tutorials again! <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

