﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-joeycih-随笔分类-Direct3D</title><link>http://www.cppblog.com/joeycih/category/11439.html</link><description>热爱游戏</description><language>zh-cn</language><lastBuildDate>Tue, 25 Aug 2009 21:48:48 GMT</lastBuildDate><pubDate>Tue, 25 Aug 2009 21:48:48 GMT</pubDate><ttl>60</ttl><item><title>D3D学习记录(二)——D3DPRESENT_PARAMETERS中的BackBufferFormat</title><link>http://www.cppblog.com/joeycih/archive/2009/08/18/93717.html</link><dc:creator>joeycih</dc:creator><author>joeycih</author><pubDate>Tue, 18 Aug 2009 10:34:00 GMT</pubDate><guid>http://www.cppblog.com/joeycih/archive/2009/08/18/93717.html</guid><wfw:comment>http://www.cppblog.com/joeycih/comments/93717.html</wfw:comment><comments>http://www.cppblog.com/joeycih/archive/2009/08/18/93717.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/joeycih/comments/commentRss/93717.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/joeycih/services/trackbacks/93717.html</trackback:ping><description><![CDATA[<dt><strong>让我们来看看DirectX的API文档<br>BackBufferFormat</strong>
<dd>The back buffer format. For more information about formats, see <u><font color=#0000ff>D3DFORMAT</font></u>. This value must be one of the render-target formats as validated by <u><font color=#0000ff>IDirect3D9::CheckDeviceType</font></u>. You can use <u><font color=#0000ff>IDirect3DDevice9::GetDisplayMode</font></u> to obtain the current format.
<dd><span style="COLOR: #ff0000">关于背景缓冲格式。更多的信息请参阅D3DFORMAT。这个值必须属于可用的IDirect3D9::CheckDeviceType渲染-目标格式。你可以通过使用IDirect3DDevice9::GetDisplayMode 来获取当前格式。</span>
<dd>&nbsp;
<dd>
<p>In fact, D3DFMT_UNKNOWN can be specified for the BackBufferFormat while in windowed mode. This tells the runtime to use the current display-mode format and eliminates the need to call <strong>IDirect3DDevice9::GetDisplayMode</strong>.<br></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="COLOR: #ff0000">&nbsp;事实上，D3DFMT_UNKNOWN可以用来使用当在窗口模式下时，这会告诉计算机去使用当前的显示模式格式从而避免去调用</span><strong><span style="COLOR: #ff0000">IDirect3DDevice9::GetDisplayMode<br></span></strong><br>For windowed applications, the back buffer format no longer needs to match the display-mode format because color conversion can now be done by the hardware (if the hardware supports color conversion). The set of possible back buffer formats is constrained, but the runtime will allow any valid back buffer format to be presented to any desktop format. (There is the additional requirement that the device be operable in the desktop mode; devices typically do not operate in 8 bits per pixel modes.)</p>
<p>Full-screen applications cannot do color conversion.<br></p>
<p style="COLOR: #ff0000" color="#ff0000">对于窗口应用程序，背景缓冲格式不再需要去符合显示模式格式因为颜色变化现在会被硬件完成(如果硬件支持颜色转换)。这样可能使背景缓冲格式受到限制，但是计算机将会允许任何有效的背景缓冲格式出现在任何的桌面格式(这里有一个附加要求device必须是可操作的在桌面模式中，device通常不会操作在8位像素模式)。<br></p>
<span style="COLOR: #ff0000">对于全屏程序是不需要颜色转换的</span></dd>
<img src ="http://www.cppblog.com/joeycih/aggbug/93717.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/joeycih/" target="_blank">joeycih</a> 2009-08-18 18:34 <a href="http://www.cppblog.com/joeycih/archive/2009/08/18/93717.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>6种基本图元-Primitive</title><link>http://www.cppblog.com/joeycih/archive/2009/08/11/92900.html</link><dc:creator>joeycih</dc:creator><author>joeycih</author><pubDate>Tue, 11 Aug 2009 06:44:00 GMT</pubDate><guid>http://www.cppblog.com/joeycih/archive/2009/08/11/92900.html</guid><wfw:comment>http://www.cppblog.com/joeycih/comments/92900.html</wfw:comment><comments>http://www.cppblog.com/joeycih/archive/2009/08/11/92900.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/joeycih/comments/commentRss/92900.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/joeycih/services/trackbacks/92900.html</trackback:ping><description><![CDATA[<h1>Primitives</h1>
<p>图元<br>A 3D primitive is a collection of vertices that form a single 3D entity. The simplest primitive is a collection of points in a 3D coordinate system, which is called a point list.<br>一个3D图元是一个顶点的集合来自一个单一的3D实体。最简单的图元是一个集合的点在3D坐标系中，那被叫做点集合。</p>
<p>Often, 3D primitives are polygons. A polygon is a closed 3D figure delineated by at least three vertices. The simplest polygon is a triangle. Microsoft Direct3D uses triangles to compose most of its polygons because all three vertices in a triangle are guaranteed to be coplanar. Rendering nonplanar vertices is inefficient. You can combine triangles to form large, complex polygons and meshes.<br></p>
<p>通常，3D图元是多边形的，一个多边形是一个由三个顶点组成的闭合的3D图形，最简单的多边形是三角形。Direct3D用三角形去组成大多数多边形是因为三角形中的所有三个顶点是一定共面的。渲染不共面的顶点是低效的。你可以组合三角形去形成更大、更复杂的多边形和网格</p>
<p>Direct3D定义了6中基本图元。</p>
<p><font color=#004040>Defines the primitives supported by Direct3D.</font></p>
<pre class=syntax><font color=#004040>typedef enum D3DPRIMITIVETYPE<br>{<br>    D3DPT_POINTLIST = 1,<br>    D3DPT_LINELIST = 2,<br>    D3DPT_LINESTRIP = 3,<br>    D3DPT_TRIANGLELIST = 4,<br>    D3DPT_TRIANGLESTRIP = 5,<br>    D3DPT_TRIANGLEFAN = 6,<br>    D3DPT_FORCE_DWORD = 0x7fffffff,<br>} D3DPRIMITIVETYPE, *LPD3DPRIMITIVETYPE;<br></font><br></pre>
<pre class=syntax><dl><dt><font color=#004040>D3DPT_POINTLIST </font><dd><font color=#004040>Renders the vertices as a collection of isolated points. This value is unsupported for indexed primitives. </font><dt><font color=#004040>D3DPT_LINELIST </font><dd><font color=#004040>Renders the vertices as a list of isolated straight line segments. </font><dt><font color=#004040>D3DPT_LINESTRIP </font><dd><font color=#004040>Renders the vertices as a single polyline. </font><dt><font color=#004040>D3DPT_TRIANGLELIST </font>
<p><font color=#004040>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Renders the specified vertices as a sequence of isolated triangles. Each group of three vertices defines a separate triangle. </font></p>
<dd><font color=#004040>Back-face culling is affected by the current winding-order render state. </font>&nbsp; <dt><font color=#004040>D3DPT_TRIANGLESTRIP </font><dd><font color=#004040>Renders the vertices as a triangle strip. The backface-culling flag is automatically flipped on even-numbered triangles. </font><dt><font color=#004040>D3DPT_TRIANGLEFAN </font><dd><font color=#004040>Renders the vertices as a triangle fan. </font><dt><font color=#004040>D3DPT_FORCE_DWORD </font><dd><font color=#004040>Forces this enumeration to compile to 32 bits in size. Without this value, some compilers would allow this enumeration to <br>compile to a size other than 32 bits. This value is not used. </font></dd></dl></pre>
<img src ="http://www.cppblog.com/joeycih/aggbug/92900.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/joeycih/" target="_blank">joeycih</a> 2009-08-11 14:44 <a href="http://www.cppblog.com/joeycih/archive/2009/08/11/92900.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>